forked from ~ljy/RK356X_SDK_RELEASE

hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/drivers/net/wireless/rockchip_wlan/cywdhd/bcmdhd/include/bcmsdh.h
....@@ -1,17 +1,18 @@
1
-/* SPDX-License-Identifier: GPL-2.0 */
21 /*
32 * SDIO host client driver interface of Broadcom HNBU
43 * export functions to client drivers
54 * abstract OS and BUS specific details of SDIO
65 *
7
- * Copyright (C) 1999-2019, Broadcom Corporation
8
- *
6
+ * Portions of this code are copyright (c) 2022 Cypress Semiconductor Corporation
7
+ *
8
+ * Copyright (C) 1999-2017, Broadcom Corporation
9
+ *
910 * Unless you and Broadcom execute a separate written software license
1011 * agreement governing use of this software, this software is licensed to you
1112 * under the terms of the GNU General Public License version 2 (the "GPL"),
1213 * available at http://www.broadcom.com/licenses/GPLv2.php, with the
1314 * following added to such license:
14
- *
15
+ *
1516 * As a special exception, the copyright holders of this software give you
1617 * permission to link this software with independent modules, and to copy and
1718 * distribute the resulting executable under terms of your choice, provided that
....@@ -19,7 +20,7 @@
1920 * the license of that module. An independent module is a module which is not
2021 * derived from this software. The special exception does not apply to any
2122 * modifications of the software.
22
- *
23
+ *
2324 * Notwithstanding the above, under no circumstances may you combine this
2425 * software in any way with any other Broadcom software provided under a license
2526 * other than the GPL, without Broadcom's express prior written consent.
....@@ -27,7 +28,7 @@
2728 *
2829 * <<Broadcom-WL-IPTag/Open:>>
2930 *
30
- * $Id: bcmsdh.h 572557 2015-07-20 07:12:29Z $
31
+ * $Id: bcmsdh.h 690946 2017-03-20 05:24:19Z $
3132 */
3233
3334 /**
....@@ -52,6 +53,14 @@
5253 /* forward declarations */
5354 typedef struct bcmsdh_info bcmsdh_info_t;
5455 typedef void (*bcmsdh_cb_fn_t)(void *);
56
+
57
+#if defined(BT_OVER_SDIO)
58
+typedef enum {
59
+ NO_HANG_STATE = 0,
60
+ HANG_START_STATE = 1,
61
+ HANG_RECOVERY_STATE = 2
62
+} dhd_hang_state_t;
63
+#endif // endif
5564
5665 extern bcmsdh_info_t *bcmsdh_attach(osl_t *osh, void *sdioh, ulong *regsva);
5766 /**
....@@ -88,7 +97,7 @@
8897 #if defined(DHD_DEBUG)
8998 /* Query pending interrupt status from the host controller */
9099 extern bool bcmsdh_intr_pending(void *sdh);
91
-#endif
100
+#endif // endif
92101
93102 /* Register a callback to be called if and when bcmsdh detects
94103 * device removal. No-op in the case of non-removable/hardwired devices.
....@@ -122,8 +131,8 @@
122131 * size: register width in bytes (2 or 4)
123132 * data: data for register write
124133 */
125
-extern uint32 bcmsdh_reg_read(void *sdh, uint32 addr, uint size);
126
-extern uint32 bcmsdh_reg_write(void *sdh, uint32 addr, uint size, uint32 data);
134
+extern uint32 bcmsdh_reg_read(void *sdh, uintptr addr, uint size);
135
+extern uint32 bcmsdh_reg_write(void *sdh, uintptr addr, uint size, uint32 data);
127136
128137 /* set sb address window */
129138 extern int bcmsdhsdio_set_sbaddr_window(void *sdh, uint32 address, bool force_set);
....@@ -193,7 +202,7 @@
193202
194203 /* Miscellaneous knob tweaker. */
195204 extern int bcmsdh_iovar_op(void *sdh, const char *name,
196
- void *params, int plen, void *arg, int len, bool set);
205
+ void *params, uint plen, void *arg, uint len, bool set);
197206
198207 /* Reset and reinitialize the device */
199208 extern int bcmsdh_reset(bcmsdh_info_t *sdh);
....@@ -223,12 +232,12 @@
223232 extern int bcmsdh_reg_sdio_notify(void* semaphore);
224233 extern void bcmsdh_unreg_sdio_notify(void);
225234
226
-#if defined(OOB_INTR_ONLY)
235
+#if defined(OOB_INTR_ONLY) || defined(BCMSPI_ANDROID)
227236 extern int bcmsdh_oob_intr_register(bcmsdh_info_t *bcmsdh, bcmsdh_cb_fn_t oob_irq_handler,
228237 void* oob_irq_handler_context);
229238 extern void bcmsdh_oob_intr_unregister(bcmsdh_info_t *sdh);
230239 extern void bcmsdh_oob_intr_set(bcmsdh_info_t *sdh, bool enable);
231
-#endif
240
+#endif /* defined(OOB_INTR_ONLY) || defined(BCMSPI_ANDROID) */
232241 extern void bcmsdh_dev_pm_stay_awake(bcmsdh_info_t *sdh);
233242 extern void bcmsdh_dev_relax(bcmsdh_info_t *sdh);
234243 extern bool bcmsdh_dev_pm_enabled(bcmsdh_info_t *sdh);
....@@ -248,6 +257,9 @@
248257 /* Function to pass chipid and rev to lower layers for controlling pr's */
249258 extern void bcmsdh_chipinfo(void *sdh, uint32 chip, uint32 chiprev);
250259
260
+#ifdef BCMSPI
261
+extern void bcmsdh_dwordmode(void *sdh, bool set);
262
+#endif /* BCMSPI */
251263
252264 extern int bcmsdh_sleep(void *sdh, bool enab);
253265