.. | .. |
---|
1 | | -/* SPDX-License-Identifier: GPL-2.0 */ |
---|
2 | 1 | /* |
---|
3 | 2 | * Definitions for ioctls to access DHD iovars. |
---|
4 | 3 | * Based on wlioctl.h (for Broadcom 802.11abg driver). |
---|
.. | .. |
---|
6 | 5 | * |
---|
7 | 6 | * Definitions subject to change without notice. |
---|
8 | 7 | * |
---|
9 | | - * Copyright (C) 1999-2019, Broadcom Corporation |
---|
10 | | - * |
---|
| 8 | + * Portions of this code are copyright (c) 2022 Cypress Semiconductor Corporation |
---|
| 9 | + * |
---|
| 10 | + * Copyright (C) 1999-2017, Broadcom Corporation |
---|
| 11 | + * |
---|
11 | 12 | * Unless you and Broadcom execute a separate written software license |
---|
12 | 13 | * agreement governing use of this software, this software is licensed to you |
---|
13 | 14 | * under the terms of the GNU General Public License version 2 (the "GPL"), |
---|
14 | 15 | * available at http://www.broadcom.com/licenses/GPLv2.php, with the |
---|
15 | 16 | * following added to such license: |
---|
16 | | - * |
---|
| 17 | + * |
---|
17 | 18 | * As a special exception, the copyright holders of this software give you |
---|
18 | 19 | * permission to link this software with independent modules, and to copy and |
---|
19 | 20 | * distribute the resulting executable under terms of your choice, provided that |
---|
.. | .. |
---|
21 | 22 | * the license of that module. An independent module is a module which is not |
---|
22 | 23 | * derived from this software. The special exception does not apply to any |
---|
23 | 24 | * modifications of the software. |
---|
24 | | - * |
---|
| 25 | + * |
---|
25 | 26 | * Notwithstanding the above, under no circumstances may you combine this |
---|
26 | 27 | * software in any way with any other Broadcom software provided under a license |
---|
27 | 28 | * other than the GPL, without Broadcom's express prior written consent. |
---|
.. | .. |
---|
29 | 30 | * |
---|
30 | 31 | * <<Broadcom-WL-IPTag/Open:>> |
---|
31 | 32 | * |
---|
32 | | - * $Id: dhdioctl.h 603083 2015-11-30 23:40:43Z $ |
---|
| 33 | + * $Id: dhdioctl.h 697634 2017-05-04 11:02:38Z $ |
---|
33 | 34 | */ |
---|
34 | 35 | |
---|
35 | 36 | #ifndef _dhdioctl_h_ |
---|
.. | .. |
---|
37 | 38 | |
---|
38 | 39 | #include <typedefs.h> |
---|
39 | 40 | |
---|
40 | | - |
---|
41 | | -/* require default structure packing */ |
---|
42 | | -#define BWL_DEFAULT_PACKING |
---|
43 | | -#include <packed_section_start.h> |
---|
44 | | - |
---|
45 | | - |
---|
46 | 41 | /* Linux network driver ioctl encoding */ |
---|
47 | 42 | typedef struct dhd_ioctl { |
---|
48 | | - uint cmd; /* common ioctl definition */ |
---|
| 43 | + uint32 cmd; /* common ioctl definition */ |
---|
49 | 44 | void *buf; /* pointer to user buffer */ |
---|
50 | | - uint len; /* length of user buffer */ |
---|
51 | | - bool set; /* get or set request (optional) */ |
---|
52 | | - uint used; /* bytes read or written (optional) */ |
---|
53 | | - uint needed; /* bytes needed (optional) */ |
---|
54 | | - uint driver; /* to identify target driver */ |
---|
| 45 | + uint32 len; /* length of user buffer */ |
---|
| 46 | + uint32 set; /* get or set request boolean (optional) */ |
---|
| 47 | + uint32 used; /* bytes read or written (optional) */ |
---|
| 48 | + uint32 needed; /* bytes needed (optional) */ |
---|
| 49 | + uint32 driver; /* to identify target driver */ |
---|
55 | 50 | } dhd_ioctl_t; |
---|
56 | 51 | |
---|
57 | 52 | /* Underlying BUS definition */ |
---|
.. | .. |
---|
61 | 56 | BUS_TYPE_PCIE /* for PCIE dongles */ |
---|
62 | 57 | }; |
---|
63 | 58 | |
---|
| 59 | +typedef enum { |
---|
| 60 | + DMA_XFER_SUCCESS = 0, |
---|
| 61 | + DMA_XFER_IN_PROGRESS, |
---|
| 62 | + DMA_XFER_FAILED |
---|
| 63 | +} dma_xfer_status_t; |
---|
| 64 | + |
---|
| 65 | +typedef enum d11_lpbk_type { |
---|
| 66 | + M2M_DMA_LPBK = 0, |
---|
| 67 | + D11_LPBK = 1, |
---|
| 68 | + BMC_LPBK = 2, |
---|
| 69 | + M2M_NON_DMA_LPBK = 3, |
---|
| 70 | + D11_HOST_MEM_LPBK = 4, |
---|
| 71 | + BMC_HOST_MEM_LPBK = 5, |
---|
| 72 | + MAX_LPBK = 6 |
---|
| 73 | +} dma_xfer_type_t; |
---|
| 74 | + |
---|
| 75 | +typedef struct dmaxfer_info { |
---|
| 76 | + uint16 version; |
---|
| 77 | + uint16 length; |
---|
| 78 | + dma_xfer_status_t status; |
---|
| 79 | + dma_xfer_type_t type; |
---|
| 80 | + uint src_delay; |
---|
| 81 | + uint dest_delay; |
---|
| 82 | + uint should_wait; |
---|
| 83 | + uint core_num; |
---|
| 84 | + int error_code; |
---|
| 85 | + uint32 num_bytes; |
---|
| 86 | + uint64 time_taken; |
---|
| 87 | + uint64 tput; |
---|
| 88 | +} dma_xfer_info_t; |
---|
| 89 | + |
---|
| 90 | +#define DHD_DMAXFER_VERSION 0x1 |
---|
| 91 | + |
---|
| 92 | +typedef struct tput_test { |
---|
| 93 | + uint16 version; |
---|
| 94 | + uint16 length; |
---|
| 95 | + uint8 direction; |
---|
| 96 | + uint8 tput_test_running; |
---|
| 97 | + uint8 mac_sta[6]; |
---|
| 98 | + uint8 mac_ap[6]; |
---|
| 99 | + uint8 PAD[2]; |
---|
| 100 | + uint32 payload_size; |
---|
| 101 | + uint32 num_pkts; |
---|
| 102 | + uint32 timeout_ms; |
---|
| 103 | + uint32 flags; |
---|
| 104 | + |
---|
| 105 | + uint32 pkts_good; |
---|
| 106 | + uint32 pkts_bad; |
---|
| 107 | + uint32 pkts_cmpl; |
---|
| 108 | + uint64 time_ms; |
---|
| 109 | + uint64 tput_bps; |
---|
| 110 | +} tput_test_t; |
---|
| 111 | + |
---|
| 112 | +typedef enum { |
---|
| 113 | + TPUT_DIR_TX = 0, |
---|
| 114 | + TPUT_DIR_RX |
---|
| 115 | +} tput_dir_t; |
---|
| 116 | + |
---|
| 117 | +#define TPUT_TEST_T_VER 1 |
---|
| 118 | +#define TPUT_TEST_T_LEN 68 |
---|
| 119 | +#define TPUT_TEST_MIN_PAYLOAD_SIZE 16 |
---|
| 120 | +#define TPUT_TEST_USE_ETHERNET_HDR 0x1 |
---|
| 121 | +#define TPUT_TEST_USE_802_11_HDR 0x2 |
---|
| 122 | + |
---|
64 | 123 | /* per-driver magic numbers */ |
---|
65 | 124 | #define DHD_IOCTL_MAGIC 0x00444944 |
---|
66 | 125 | |
---|
67 | 126 | /* bump this number if you change the ioctl interface */ |
---|
68 | 127 | #define DHD_IOCTL_VERSION 1 |
---|
69 | 128 | |
---|
70 | | -#define DHD_IOCTL_MAXLEN 8192 /* max length ioctl buffer required */ |
---|
| 129 | +/* |
---|
| 130 | + * Increase the DHD_IOCTL_MAXLEN to 16K for supporting download of NVRAM files of size |
---|
| 131 | + * > 8K. In the existing implementation when NVRAM is to be downloaded via the "vars" |
---|
| 132 | + * DHD IOVAR, the NVRAM is copied to the DHD Driver memory. Later on when "dwnldstate" is |
---|
| 133 | + * invoked with FALSE option, the NVRAM gets copied from the DHD driver to the Dongle |
---|
| 134 | + * memory. The simple way to support this feature without modifying the DHD application, |
---|
| 135 | + * driver logic is to increase the DHD_IOCTL_MAXLEN size. This macro defines the "size" |
---|
| 136 | + * of the buffer in which data is exchanged between the DHD App and DHD driver. |
---|
| 137 | + */ |
---|
| 138 | +#define DHD_IOCTL_MAXLEN (16384) /* max length ioctl buffer required */ |
---|
71 | 139 | #define DHD_IOCTL_SMLEN 256 /* "small" length ioctl buffer required */ |
---|
72 | 140 | |
---|
73 | 141 | /* common ioctl definitions */ |
---|
.. | .. |
---|
97 | 165 | #define DHD_NOCHECKDIED_VAL 0x20000 /* UTF WAR */ |
---|
98 | 166 | #define DHD_WL_VAL2 0x40000 |
---|
99 | 167 | #define DHD_PNO_VAL 0x80000 |
---|
100 | | -#define DHD_MSGTRACE_VAL 0x100000 |
---|
| 168 | +#define DHD_RTT_VAL 0x100000 |
---|
| 169 | +#define DHD_MSGTRACE_VAL 0x200000 |
---|
101 | 170 | #define DHD_FWLOG_VAL 0x400000 |
---|
102 | | -#define DHD_RTT_VAL 0x200000 |
---|
103 | 171 | #define DHD_DBGIF_VAL 0x800000 |
---|
104 | | -#define DHD_DBG_BCNRX_VAL 0x1000000 |
---|
| 172 | +#ifdef DHD_PCIE_NATIVE_RUNTIMEPM |
---|
| 173 | +#define DHD_RPM_VAL 0x1000000 |
---|
| 174 | +#endif /* DHD_PCIE_NATIVE_RUNTIMEPM */ |
---|
| 175 | +#define DHD_PKT_MON_VAL 0x2000000 |
---|
| 176 | +#define DHD_PKT_MON_DUMP_VAL 0x4000000 |
---|
| 177 | +#define DHD_ERROR_MEM_VAL 0x8000000 |
---|
| 178 | +#define DHD_DNGL_IOVAR_SET_VAL 0x10000000 /**< logs the setting of dongle iovars */ |
---|
| 179 | +#define DHD_LPBKDTDUMP_VAL 0x20000000 |
---|
| 180 | +#define DHD_PRSRV_MEM_VAL 0x40000000 |
---|
| 181 | +#define DHD_IOVAR_MEM_VAL 0x80000000 |
---|
105 | 182 | |
---|
106 | 183 | #ifdef SDTEST |
---|
107 | 184 | /* For pktgen iovar */ |
---|
108 | 185 | typedef struct dhd_pktgen { |
---|
109 | | - uint version; /* To allow structure change tracking */ |
---|
110 | | - uint freq; /* Max ticks between tx/rx attempts */ |
---|
111 | | - uint count; /* Test packets to send/rcv each attempt */ |
---|
112 | | - uint print; /* Print counts every <print> attempts */ |
---|
113 | | - uint total; /* Total packets (or bursts) */ |
---|
114 | | - uint minlen; /* Minimum length of packets to send */ |
---|
115 | | - uint maxlen; /* Maximum length of packets to send */ |
---|
116 | | - uint numsent; /* Count of test packets sent */ |
---|
117 | | - uint numrcvd; /* Count of test packets received */ |
---|
118 | | - uint numfail; /* Count of test send failures */ |
---|
119 | | - uint mode; /* Test mode (type of test packets) */ |
---|
120 | | - uint stop; /* Stop after this many tx failures */ |
---|
| 186 | + uint32 version; /* To allow structure change tracking */ |
---|
| 187 | + uint32 freq; /* Max ticks between tx/rx attempts */ |
---|
| 188 | + uint32 count; /* Test packets to send/rcv each attempt */ |
---|
| 189 | + uint32 print; /* Print counts every <print> attempts */ |
---|
| 190 | + uint32 total; /* Total packets (or bursts) */ |
---|
| 191 | + uint32 minlen; /* Minimum length of packets to send */ |
---|
| 192 | + uint32 maxlen; /* Maximum length of packets to send */ |
---|
| 193 | + uint32 numsent; /* Count of test packets sent */ |
---|
| 194 | + uint32 numrcvd; /* Count of test packets received */ |
---|
| 195 | + uint32 numfail; /* Count of test send failures */ |
---|
| 196 | + uint32 mode; /* Test mode (type of test packets) */ |
---|
| 197 | + uint32 stop; /* Stop after this many tx failures */ |
---|
121 | 198 | } dhd_pktgen_t; |
---|
122 | 199 | |
---|
123 | 200 | /* Version in case structure changes */ |
---|
.. | .. |
---|
137 | 214 | #define DHD_IDLE_ACTIVE 0 /* Do not request any SD clock change when idle */ |
---|
138 | 215 | #define DHD_IDLE_STOP (-1) /* Request SD clock be stopped (and use SD1 mode) */ |
---|
139 | 216 | |
---|
140 | | - |
---|
141 | 217 | enum dhd_maclist_xtlv_type { |
---|
142 | 218 | DHD_MACLIST_XTLV_R = 0x1, |
---|
143 | | - DHD_MACLIST_XTLV_X = 0x2 |
---|
| 219 | + DHD_MACLIST_XTLV_X = 0x2, |
---|
| 220 | + DHD_SVMPLIST_XTLV = 0x3 |
---|
144 | 221 | }; |
---|
145 | 222 | |
---|
146 | 223 | typedef struct _dhd_maclist_t { |
---|
.. | .. |
---|
162 | 239 | uint8 pbuf[1]; |
---|
163 | 240 | } dhd_pd11regs_buf; |
---|
164 | 241 | |
---|
165 | | -/* require default structure packing */ |
---|
166 | | -#include <packed_section_end.h> |
---|
| 242 | +/* BT logging and memory dump */ |
---|
| 243 | + |
---|
| 244 | +#define BT_LOG_BUF_MAX_SIZE (DHD_IOCTL_MAXLEN - (2 * sizeof(int))) |
---|
| 245 | +#define BT_LOG_BUF_NOT_AVAILABLE 0 |
---|
| 246 | +#define BT_LOG_NEXT_BUF_NOT_AVAIL 1 |
---|
| 247 | +#define BT_LOG_NEXT_BUF_AVAIL 2 |
---|
| 248 | +#define BT_LOG_NOT_READY 3 |
---|
| 249 | + |
---|
| 250 | +typedef struct bt_log_buf_info { |
---|
| 251 | + int availability; |
---|
| 252 | + int size; |
---|
| 253 | + char buf[BT_LOG_BUF_MAX_SIZE]; |
---|
| 254 | +} bt_log_buf_info_t; |
---|
| 255 | + |
---|
| 256 | +/* request BT memory in chunks */ |
---|
| 257 | +typedef struct bt_mem_req { |
---|
| 258 | + int offset; /* offset from BT memory start */ |
---|
| 259 | + int buf_size; /* buffer size per chunk */ |
---|
| 260 | +} bt_mem_req_t; |
---|
| 261 | + |
---|
| 262 | +/* max dest supported */ |
---|
| 263 | +#define DEBUG_BUF_DEST_MAX 4 |
---|
| 264 | + |
---|
| 265 | +/* debug buf dest stat */ |
---|
| 266 | +typedef struct debug_buf_dest_stat { |
---|
| 267 | + uint32 stat[DEBUG_BUF_DEST_MAX]; |
---|
| 268 | +} debug_buf_dest_stat_t; |
---|
167 | 269 | |
---|
168 | 270 | #endif /* _dhdioctl_h_ */ |
---|