blob: 337c548b29156237f7d1dbcac3ec3570dd79ce26 [file] [log] [blame]
Nandha Kishore Easwarane5444bc2016-10-20 13:23:23 +05301/*
Basamma Yakkanahallib85768e2019-04-27 05:24:00 +05302 * Copyright (c) 2011-2019 The Linux Foundation. All rights reserved.
Nandha Kishore Easwarane5444bc2016-10-20 13:23:23 +05303 *
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
Vijay Pamidipati537d9292016-12-11 13:39:14 +053027#include "hif_main.h"
28
Himanshu Agarwalf064db92016-12-29 12:25:35 +053029#define MOB_DRV_LEGACY_DP 0xdeed/*FIXME Add MCL device IDs */
Venkateswara Swamy Bandaru1f0755c2018-08-17 18:38:49 +053030#define LITHIUM_DP 0xfffd/*FIXME Add Litium device ID */
Nandha Kishore Easwarane5444bc2016-10-20 13:23:23 +053031/* Use these device IDs for attach in future */
32
Saket Jha1d97e0c2019-08-27 10:40:00 -070033#if defined(DP_TXRX_SOC_ATTACH)
34static inline ol_txrx_soc_handle
35ol_txrx_soc_attach(void *scn_handle, struct ol_if_ops *dp_ol_if_ops)
36{
37 return NULL;
38}
39#else
40ol_txrx_soc_handle
41ol_txrx_soc_attach(void *scn_handle, struct ol_if_ops *dp_ol_if_ops);
42#endif
Nandha Kishore Easwarane5444bc2016-10-20 13:23:23 +053043
Adil Saeed Musthafa61a21692018-07-17 20:49:31 -070044/**
Leo Changdb6358c2016-09-27 17:00:52 -070045 * dp_soc_attach_wifi3() - Attach txrx SOC
Sathyanarayanan Esakkiappan38c6f982017-12-05 12:00:31 +053046 * @ctrl_psoc: Opaque SOC handle from Ctrl plane
Leo Changdb6358c2016-09-27 17:00:52 -070047 * @htc_handle: Opaque HTC handle
48 * @hif_handle: Opaque HIF handle
49 * @qdf_osdev: QDF device
Adil Saeed Musthafa61a21692018-07-17 20:49:31 -070050 * @ol_ops: Offload Operations
51 * @device_id: Device ID
Leo Changdb6358c2016-09-27 17:00:52 -070052 *
53 * Return: DP SOC handle on success, NULL on failure
54 */
Anish Nataraje9d4c3b2018-11-24 22:24:56 +053055
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 */
Basamma Yakkanahallib85768e2019-04-27 05:24:00 +053068#if defined(QCA_WIFI_QCA8074) || defined(QCA_WIFI_QCA6018)
Akshay Kosigi4002f762019-07-08 23:04:36 +053069struct cdp_soc_t *
70dp_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);
Pavankumar Nandeshwara2347162019-12-18 23:20:31 +053074void *dp_soc_init_wifi3(struct cdp_soc_t *soc,
75 struct cdp_ctrl_objmgr_psoc *ctrl_psoc,
Akshay Kosigi4002f762019-07-08 23:04:36 +053076 struct hif_opaque_softc *hif_handle,
Anish Nataraje9d4c3b2018-11-24 22:24:56 +053077 HTC_HANDLE htc_handle, qdf_device_t qdf_osdev,
78 struct ol_if_ops *ol_ops, uint16_t device_id);
Adil Saeed Musthafa61a21692018-07-17 20:49:31 -070079#else
Akshay Kosigi4002f762019-07-08 23:04:36 +053080static inline
81struct 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)
Leo Changdb6358c2016-09-27 17:00:52 -070087{
88 return NULL;
89}
Anish Nataraje9d4c3b2018-11-24 22:24:56 +053090
91static inline
Pavankumar Nandeshwara2347162019-12-18 23:20:31 +053092void *dp_soc_init_wifi3(struct cdp_soc_t *soc,
93 struct cdp_ctrl_objmgr_psoc *ctrl_psoc,
Akshay Kosigi4002f762019-07-08 23:04:36 +053094 struct hif_opaque_softc *hif_handle,
Anish Nataraje9d4c3b2018-11-24 22:24:56 +053095 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}
Leo Changdb6358c2016-09-27 17:00:52 -0700100#endif /* QCA_WIFI_QCA8074 */
101
Himanshu Batra032d3522019-07-10 12:36:06 +0530102static 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)
Nandha Kishore Easwarane5444bc2016-10-20 13:23:23 +0530106{
107 switch (devid) {
108 case LITHIUM_DP: /*FIXME Add lithium devide IDs */
Vijay Pamidipati537d9292016-12-11 13:39:14 +0530109 case QCA8074_DEVICE_ID: /* Hawekeye */
Venkateswara Swamy Bandaru1f0755c2018-08-17 18:38:49 +0530110 case QCA8074V2_DEVICE_ID: /* Hawekeye V2*/
Balamurugan Mahalingam3ab36332018-01-29 19:15:02 +0530111 case QCA6290_DEVICE_ID:
Nandha Kishore Easwaran5d3475b2019-06-27 11:38:53 +0530112 case QCN9000_DEVICE_ID:
Venkata Sharath Chandra Manchala79860aa2018-06-12 15:16:36 -0700113 case QCA6390_DEVICE_ID:
Venkata Sharath Chandra Manchalae69c9c22019-09-23 18:31:36 -0700114 case QCA6490_DEVICE_ID:
Venkata Sharath Chandra Manchala79860aa2018-06-12 15:16:36 -0700115 case QCA6390_EMULATION_DEVICE_ID:
Vijay Pamidipati537d9292016-12-11 13:39:14 +0530116 case RUMIM2M_DEVICE_ID_NODE0: /*lithium emulation */
117 case RUMIM2M_DEVICE_ID_NODE1: /*lithium emulation */
Sathish Kumar2d2f19a2017-02-13 15:52:07 +0530118 case RUMIM2M_DEVICE_ID_NODE2: /*lithium emulation */
119 case RUMIM2M_DEVICE_ID_NODE3: /*lithium emulation */
Basamma Yakkanahalli5f7cfd42018-11-02 15:52:37 +0530120 case RUMIM2M_DEVICE_ID_NODE4: /*lithium emulation */
121 case RUMIM2M_DEVICE_ID_NODE5: /*lithium emulation */
Sathyanarayanan Esakkiappan38c6f982017-12-05 12:00:31 +0530122 return dp_soc_attach_wifi3(psoc, hif_handle, htc_handle,
Adil Saeed Musthafa61a21692018-07-17 20:49:31 -0700123 qdf_dev, dp_ol_if_ops, devid);
Nandha Kishore Easwarane5444bc2016-10-20 13:23:23 +0530124 break;
125 default:
Sathyanarayanan Esakkiappan38c6f982017-12-05 12:00:31 +0530126 return ol_txrx_soc_attach(psoc, dp_ol_if_ops);
Nandha Kishore Easwarane5444bc2016-10-20 13:23:23 +0530127 }
128 return NULL;
129}
130
131#endif /*_CDP_TXRX_CMN_REG_H_ */