From d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d Mon Sep 17 00:00:00 2001
From: hc <hc@nodka.com>
Date: Mon, 11 Dec 2023 02:45:28 +0000
Subject: [PATCH] add boot partition  size

---
 kernel/drivers/net/wireless/rockchip_wlan/cywdhd/bcmdhd/include/dhdioctl.h |  178 ++++++++++++++++++++++++++++++++++++++++++++++------------
 1 files changed, 140 insertions(+), 38 deletions(-)

diff --git a/kernel/drivers/net/wireless/rockchip_wlan/cywdhd/bcmdhd/include/dhdioctl.h b/kernel/drivers/net/wireless/rockchip_wlan/cywdhd/bcmdhd/include/dhdioctl.h
index be1d1377..27d3118 100644
--- a/kernel/drivers/net/wireless/rockchip_wlan/cywdhd/bcmdhd/include/dhdioctl.h
+++ b/kernel/drivers/net/wireless/rockchip_wlan/cywdhd/bcmdhd/include/dhdioctl.h
@@ -1,4 +1,3 @@
-/* SPDX-License-Identifier: GPL-2.0 */
 /*
  * Definitions for ioctls to access DHD iovars.
  * Based on wlioctl.h (for Broadcom 802.11abg driver).
@@ -6,14 +5,16 @@
  *
  * Definitions subject to change without notice.
  *
- * Copyright (C) 1999-2019, Broadcom Corporation
- * 
+ * Portions of this code are copyright (c) 2022 Cypress Semiconductor Corporation
+ *
+ * Copyright (C) 1999-2017, Broadcom Corporation
+ *
  *      Unless you and Broadcom execute a separate written software license
  * agreement governing use of this software, this software is licensed to you
  * under the terms of the GNU General Public License version 2 (the "GPL"),
  * available at http://www.broadcom.com/licenses/GPLv2.php, with the
  * following added to such license:
- * 
+ *
  *      As a special exception, the copyright holders of this software give you
  * permission to link this software with independent modules, and to copy and
  * distribute the resulting executable under terms of your choice, provided that
@@ -21,7 +22,7 @@
  * the license of that module.  An independent module is a module which is not
  * derived from this software.  The special exception does not apply to any
  * modifications of the software.
- * 
+ *
  *      Notwithstanding the above, under no circumstances may you combine this
  * software in any way with any other Broadcom software provided under a license
  * other than the GPL, without Broadcom's express prior written consent.
@@ -29,7 +30,7 @@
  *
  * <<Broadcom-WL-IPTag/Open:>>
  *
- * $Id: dhdioctl.h 603083 2015-11-30 23:40:43Z $
+ * $Id: dhdioctl.h 697634 2017-05-04 11:02:38Z $
  */
 
 #ifndef _dhdioctl_h_
@@ -37,21 +38,15 @@
 
 #include <typedefs.h>
 
-
-/* require default structure packing */
-#define BWL_DEFAULT_PACKING
-#include <packed_section_start.h>
-
-
 /* Linux network driver ioctl encoding */
 typedef struct dhd_ioctl {
-	uint cmd;	/* common ioctl definition */
+	uint32 cmd;	/* common ioctl definition */
 	void *buf;	/* pointer to user buffer */
-	uint len;	/* length of user buffer */
-	bool set;	/* get or set request (optional) */
-	uint used;	/* bytes read or written (optional) */
-	uint needed;	/* bytes needed (optional) */
-	uint driver;	/* to identify target driver */
+	uint32 len;	/* length of user buffer */
+	uint32 set;	/* get or set request boolean (optional) */
+	uint32 used;	/* bytes read or written (optional) */
+	uint32 needed;	/* bytes needed (optional) */
+	uint32 driver;	/* to identify target driver */
 } dhd_ioctl_t;
 
 /* Underlying BUS definition */
@@ -61,13 +56,86 @@
 	BUS_TYPE_PCIE /* for PCIE dongles */
 };
 
+typedef enum {
+	DMA_XFER_SUCCESS = 0,
+	DMA_XFER_IN_PROGRESS,
+	DMA_XFER_FAILED
+} dma_xfer_status_t;
+
+typedef enum d11_lpbk_type {
+	M2M_DMA_LPBK = 0,
+	D11_LPBK = 1,
+	BMC_LPBK = 2,
+	M2M_NON_DMA_LPBK = 3,
+	D11_HOST_MEM_LPBK = 4,
+	BMC_HOST_MEM_LPBK = 5,
+	MAX_LPBK = 6
+} dma_xfer_type_t;
+
+typedef struct dmaxfer_info {
+	uint16 version;
+	uint16 length;
+	dma_xfer_status_t status;
+	dma_xfer_type_t type;
+	uint src_delay;
+	uint dest_delay;
+	uint should_wait;
+	uint core_num;
+	int error_code;
+	uint32 num_bytes;
+	uint64 time_taken;
+	uint64 tput;
+} dma_xfer_info_t;
+
+#define DHD_DMAXFER_VERSION 0x1
+
+typedef struct tput_test {
+	uint16 version;
+	uint16 length;
+	uint8 direction;
+	uint8 tput_test_running;
+	uint8 mac_sta[6];
+	uint8 mac_ap[6];
+	uint8 PAD[2];
+	uint32 payload_size;
+	uint32 num_pkts;
+	uint32 timeout_ms;
+	uint32 flags;
+
+	uint32 pkts_good;
+	uint32 pkts_bad;
+	uint32 pkts_cmpl;
+	uint64 time_ms;
+	uint64 tput_bps;
+} tput_test_t;
+
+typedef enum {
+	TPUT_DIR_TX = 0,
+	TPUT_DIR_RX
+} tput_dir_t;
+
+#define TPUT_TEST_T_VER 1
+#define TPUT_TEST_T_LEN 68
+#define TPUT_TEST_MIN_PAYLOAD_SIZE 16
+#define TPUT_TEST_USE_ETHERNET_HDR 0x1
+#define TPUT_TEST_USE_802_11_HDR 0x2
+
 /* per-driver magic numbers */
 #define DHD_IOCTL_MAGIC		0x00444944
 
 /* bump this number if you change the ioctl interface */
 #define DHD_IOCTL_VERSION	1
 
-#define	DHD_IOCTL_MAXLEN	8192		/* max length ioctl buffer required */
+/*
+ * Increase the DHD_IOCTL_MAXLEN to 16K for supporting download of NVRAM files of size
+ * > 8K. In the existing implementation when NVRAM is to be downloaded via the "vars"
+ * DHD IOVAR, the NVRAM is copied to the DHD Driver memory. Later on when "dwnldstate" is
+ * invoked with FALSE option, the NVRAM gets copied from the DHD driver to the Dongle
+ * memory. The simple way to support this feature without modifying the DHD application,
+ * driver logic is to increase the DHD_IOCTL_MAXLEN size. This macro defines the "size"
+ * of the buffer in which data is exchanged between the DHD App and DHD driver.
+ */
+#define	DHD_IOCTL_MAXLEN	(16384)	/* max length ioctl buffer required */
 #define	DHD_IOCTL_SMLEN		256		/* "small" length ioctl buffer required */
 
 /* common ioctl definitions */
@@ -97,27 +165,36 @@
 #define DHD_NOCHECKDIED_VAL		0x20000 /* UTF WAR */
 #define DHD_WL_VAL2		0x40000
 #define DHD_PNO_VAL		0x80000
-#define DHD_MSGTRACE_VAL	0x100000
+#define DHD_RTT_VAL		0x100000
+#define DHD_MSGTRACE_VAL	0x200000
 #define DHD_FWLOG_VAL		0x400000
-#define DHD_RTT_VAL		0x200000
 #define DHD_DBGIF_VAL		0x800000
-#define DHD_DBG_BCNRX_VAL	0x1000000
+#ifdef DHD_PCIE_NATIVE_RUNTIMEPM
+#define DHD_RPM_VAL		0x1000000
+#endif /* DHD_PCIE_NATIVE_RUNTIMEPM */
+#define DHD_PKT_MON_VAL		0x2000000
+#define DHD_PKT_MON_DUMP_VAL	0x4000000
+#define DHD_ERROR_MEM_VAL	0x8000000
+#define DHD_DNGL_IOVAR_SET_VAL	0x10000000 /**< logs the setting of dongle iovars */
+#define DHD_LPBKDTDUMP_VAL	0x20000000
+#define DHD_PRSRV_MEM_VAL	0x40000000
+#define DHD_IOVAR_MEM_VAL	0x80000000
 
 #ifdef SDTEST
 /* For pktgen iovar */
 typedef struct dhd_pktgen {
-	uint version;		/* To allow structure change tracking */
-	uint freq;		/* Max ticks between tx/rx attempts */
-	uint count;		/* Test packets to send/rcv each attempt */
-	uint print;		/* Print counts every <print> attempts */
-	uint total;		/* Total packets (or bursts) */
-	uint minlen;		/* Minimum length of packets to send */
-	uint maxlen;		/* Maximum length of packets to send */
-	uint numsent;		/* Count of test packets sent */
-	uint numrcvd;		/* Count of test packets received */
-	uint numfail;		/* Count of test send failures */
-	uint mode;		/* Test mode (type of test packets) */
-	uint stop;		/* Stop after this many tx failures */
+	uint32 version;		/* To allow structure change tracking */
+	uint32 freq;		/* Max ticks between tx/rx attempts */
+	uint32 count;		/* Test packets to send/rcv each attempt */
+	uint32 print;		/* Print counts every <print> attempts */
+	uint32 total;		/* Total packets (or bursts) */
+	uint32 minlen;		/* Minimum length of packets to send */
+	uint32 maxlen;		/* Maximum length of packets to send */
+	uint32 numsent;		/* Count of test packets sent */
+	uint32 numrcvd;		/* Count of test packets received */
+	uint32 numfail;		/* Count of test send failures */
+	uint32 mode;		/* Test mode (type of test packets) */
+	uint32 stop;		/* Stop after this many tx failures */
 } dhd_pktgen_t;
 
 /* Version in case structure changes */
@@ -137,10 +214,10 @@
 #define DHD_IDLE_ACTIVE	0	/* Do not request any SD clock change when idle */
 #define DHD_IDLE_STOP   (-1)	/* Request SD clock be stopped (and use SD1 mode) */
 
-
 enum dhd_maclist_xtlv_type {
 	DHD_MACLIST_XTLV_R = 0x1,
-	DHD_MACLIST_XTLV_X = 0x2
+	DHD_MACLIST_XTLV_X = 0x2,
+	DHD_SVMPLIST_XTLV = 0x3
 };
 
 typedef struct _dhd_maclist_t {
@@ -162,7 +239,32 @@
 	uint8 pbuf[1];
 } dhd_pd11regs_buf;
 
-/* require default structure packing */
-#include <packed_section_end.h>
+/* BT logging and memory dump */
+
+#define BT_LOG_BUF_MAX_SIZE		(DHD_IOCTL_MAXLEN - (2 * sizeof(int)))
+#define BT_LOG_BUF_NOT_AVAILABLE	0
+#define BT_LOG_NEXT_BUF_NOT_AVAIL	1
+#define BT_LOG_NEXT_BUF_AVAIL		2
+#define BT_LOG_NOT_READY		3
+
+typedef struct bt_log_buf_info {
+	int availability;
+	int size;
+	char buf[BT_LOG_BUF_MAX_SIZE];
+} bt_log_buf_info_t;
+
+/* request BT memory in chunks */
+typedef struct bt_mem_req {
+	int offset;	/* offset from BT memory start */
+	int buf_size;	/* buffer size per chunk */
+} bt_mem_req_t;
+
+/* max dest supported */
+#define DEBUG_BUF_DEST_MAX	4
+
+/* debug buf dest stat */
+typedef struct debug_buf_dest_stat {
+	uint32 stat[DEBUG_BUF_DEST_MAX];
+} debug_buf_dest_stat_t;
 
 #endif /* _dhdioctl_h_ */

--
Gitblit v1.6.2