| .. | .. |
|---|
| 1 | | -/* SPDX-License-Identifier: GPL-2.0 */ |
|---|
| 2 | 1 | /* |
|---|
| 3 | 2 | * DHD debugability header file |
|---|
| 4 | 3 | * |
|---|
| 5 | | - * Copyright (C) 1999-2019, Broadcom Corporation |
|---|
| 6 | | - * |
|---|
| 4 | + * <<Broadcom-WL-IPTag/Open:>> |
|---|
| 5 | + * |
|---|
| 6 | + * Portions of this code are copyright (c) 2022 Cypress Semiconductor Corporation |
|---|
| 7 | + * |
|---|
| 8 | + * Copyright (C) 1999-2017, Broadcom Corporation |
|---|
| 9 | + * |
|---|
| 7 | 10 | * Unless you and Broadcom execute a separate written software license |
|---|
| 8 | 11 | * agreement governing use of this software, this software is licensed to you |
|---|
| 9 | 12 | * under the terms of the GNU General Public License version 2 (the "GPL"), |
|---|
| 10 | 13 | * available at http://www.broadcom.com/licenses/GPLv2.php, with the |
|---|
| 11 | 14 | * following added to such license: |
|---|
| 12 | | - * |
|---|
| 15 | + * |
|---|
| 13 | 16 | * As a special exception, the copyright holders of this software give you |
|---|
| 14 | 17 | * permission to link this software with independent modules, and to copy and |
|---|
| 15 | 18 | * distribute the resulting executable under terms of your choice, provided that |
|---|
| .. | .. |
|---|
| 17 | 20 | * the license of that module. An independent module is a module which is not |
|---|
| 18 | 21 | * derived from this software. The special exception does not apply to any |
|---|
| 19 | 22 | * modifications of the software. |
|---|
| 20 | | - * |
|---|
| 23 | + * |
|---|
| 21 | 24 | * Notwithstanding the above, under no circumstances may you combine this |
|---|
| 22 | 25 | * software in any way with any other Broadcom software provided under a license |
|---|
| 23 | 26 | * other than the GPL, without Broadcom's express prior written consent. |
|---|
| 24 | 27 | * |
|---|
| 25 | | - * $Id: dhd_debug.h 560028 2015-05-29 10:50:33Z $ |
|---|
| 28 | + * $Id: dhd_debug.h 701031 2017-05-23 11:19:09Z $ |
|---|
| 26 | 29 | */ |
|---|
| 27 | 30 | |
|---|
| 28 | 31 | #ifndef _dhd_debug_h_ |
|---|
| 29 | 32 | #define _dhd_debug_h_ |
|---|
| 33 | +#include <event_log.h> |
|---|
| 34 | +#include <bcmutils.h> |
|---|
| 35 | +#include <dhd_dbg_ring.h> |
|---|
| 36 | + |
|---|
| 30 | 37 | enum { |
|---|
| 31 | 38 | DEBUG_RING_ID_INVALID = 0, |
|---|
| 32 | 39 | FW_VERBOSE_RING_ID, |
|---|
| 33 | | - FW_EVENT_RING_ID, |
|---|
| 34 | 40 | DHD_EVENT_RING_ID, |
|---|
| 35 | | - NAN_EVENT_RING_ID, |
|---|
| 36 | 41 | /* add new id here */ |
|---|
| 37 | 42 | DEBUG_RING_ID_MAX |
|---|
| 38 | 43 | }; |
|---|
| .. | .. |
|---|
| 46 | 51 | DBG_WAKE_LOCK_SUPPORTED = (1 << (4)), /* WAKE LOCK of Driver */ |
|---|
| 47 | 52 | DBG_VERBOSE_LOG_SUPPORTED = (1 << (5)), /* verbose log of FW */ |
|---|
| 48 | 53 | DBG_HEALTH_CHECK_SUPPORTED = (1 << (6)), /* monitor the health of FW */ |
|---|
| 49 | | - DBG_NAN_EVENT_SUPPORTED = (1 << (7)), /* NAN Events */ |
|---|
| 54 | + DBG_DRIVER_DUMP_SUPPORTED = (1 << (7)), /* dumps driver state */ |
|---|
| 55 | + DBG_PACKET_FATE_SUPPORTED = (1 << (8)), /* tracks connection packets' fate */ |
|---|
| 56 | + DBG_NAN_EVENT_SUPPORTED = (1 << (9)), /* NAN Events */ |
|---|
| 50 | 57 | }; |
|---|
| 51 | 58 | |
|---|
| 52 | 59 | enum { |
|---|
| .. | .. |
|---|
| 56 | 63 | DBG_RING_ENTRY_FLAGS_HAS_TIMESTAMP = (1 << (1)) |
|---|
| 57 | 64 | }; |
|---|
| 58 | 65 | |
|---|
| 59 | | -#define DBGRING_NAME_MAX 32 |
|---|
| 60 | 66 | /* firmware verbose ring, ring id 1 */ |
|---|
| 61 | 67 | #define FW_VERBOSE_RING_NAME "fw_verbose" |
|---|
| 62 | | -#define FW_VERBOSE_RING_SIZE (64 * 1024) |
|---|
| 68 | +#define FW_VERBOSE_RING_SIZE (256 * 1024) |
|---|
| 63 | 69 | /* firmware event ring, ring id 2 */ |
|---|
| 64 | 70 | #define FW_EVENT_RING_NAME "fw_event" |
|---|
| 65 | 71 | #define FW_EVENT_RING_SIZE (64 * 1024) |
|---|
| .. | .. |
|---|
| 70 | 76 | #define NAN_EVENT_RING_NAME "nan_event" |
|---|
| 71 | 77 | #define NAN_EVENT_RING_SIZE (64 * 1024) |
|---|
| 72 | 78 | |
|---|
| 73 | | -#define DBG_RING_STATUS_SIZE (sizeof(dhd_dbg_ring_status_t)) |
|---|
| 79 | +#define TLV_LOG_SIZE(tlv) ((tlv) ? (sizeof(tlv_log) + (tlv)->len) : 0) |
|---|
| 80 | + |
|---|
| 81 | +#define TLV_LOG_NEXT(tlv) \ |
|---|
| 82 | + ((tlv) ? ((tlv_log *)((uint8 *)tlv + TLV_LOG_SIZE(tlv))) : 0) |
|---|
| 74 | 83 | |
|---|
| 75 | 84 | #define VALID_RING(id) \ |
|---|
| 76 | | - (id > DEBUG_RING_ID_INVALID && id < DEBUG_RING_ID_MAX) |
|---|
| 85 | + ((id > DEBUG_RING_ID_INVALID) && (id < DEBUG_RING_ID_MAX)) |
|---|
| 86 | + |
|---|
| 87 | +#ifdef DEBUGABILITY |
|---|
| 88 | +#define DBG_RING_ACTIVE(dhdp, ring_id) \ |
|---|
| 89 | + ((dhdp)->dbg->dbg_rings[(ring_id)].state == RING_ACTIVE) |
|---|
| 90 | +#else |
|---|
| 91 | +#define DBG_RING_ACTIVE(dhdp, ring_id) 0 |
|---|
| 92 | +#endif /* DEBUGABILITY */ |
|---|
| 77 | 93 | |
|---|
| 78 | 94 | enum { |
|---|
| 79 | 95 | /* driver receive association command from kernel */ |
|---|
| .. | .. |
|---|
| 113 | 129 | WIFI_EVENT_FW_EAPOL_FRAME_TRANSMIT_STOP, |
|---|
| 114 | 130 | /* kernel queue EAPOL for transmission in driver with EAPOL index 1-4 */ |
|---|
| 115 | 131 | WIFI_EVENT_DRIVER_EAPOL_FRAME_TRANSMIT_REQUESTED, |
|---|
| 116 | | - /* |
|---|
| 117 | | - * with rate, regardless of the fact that EAPOL frame is accepted or |
|---|
| 132 | + /* with rate, regardless of the fact that EAPOL frame is accepted or |
|---|
| 118 | 133 | * rejected by firmware |
|---|
| 119 | 134 | */ |
|---|
| 120 | 135 | WIFI_EVENT_FW_EAPOL_FRAME_RECEIVED, |
|---|
| .. | .. |
|---|
| 138 | 153 | /* firmware sends assoc/reassoc frame in */ |
|---|
| 139 | 154 | WIFI_EVENT_ROAM_ASSOC_STARTED, |
|---|
| 140 | 155 | /* firmware receive assoc/reassoc confirm from ap */ |
|---|
| 141 | | - WIFI_EVENT_ROAM_ASSOC_COMPLETE |
|---|
| 156 | + WIFI_EVENT_ROAM_ASSOC_COMPLETE, |
|---|
| 157 | + /* firmware sends stop G_SCAN */ |
|---|
| 158 | + WIFI_EVENT_G_SCAN_STOP, |
|---|
| 159 | + /* firmware indicates G_SCAN scan cycle started */ |
|---|
| 160 | + WIFI_EVENT_G_SCAN_CYCLE_STARTED, |
|---|
| 161 | + /* firmware indicates G_SCAN scan cycle completed */ |
|---|
| 162 | + WIFI_EVENT_G_SCAN_CYCLE_COMPLETED, |
|---|
| 163 | + /* firmware indicates G_SCAN scan start for a particular bucket */ |
|---|
| 164 | + WIFI_EVENT_G_SCAN_BUCKET_STARTED, |
|---|
| 165 | + /* firmware indicates G_SCAN scan completed for particular bucket */ |
|---|
| 166 | + WIFI_EVENT_G_SCAN_BUCKET_COMPLETED, |
|---|
| 167 | + /* Event received from firmware about G_SCAN scan results being available */ |
|---|
| 168 | + WIFI_EVENT_G_SCAN_RESULTS_AVAILABLE, |
|---|
| 169 | + /* Event received from firmware with G_SCAN capabilities */ |
|---|
| 170 | + WIFI_EVENT_G_SCAN_CAPABILITIES, |
|---|
| 171 | + /* Event received from firmware when eligible candidate is found */ |
|---|
| 172 | + WIFI_EVENT_ROAM_CANDIDATE_FOUND, |
|---|
| 173 | + /* Event received from firmware when roam scan configuration gets enabled or disabled */ |
|---|
| 174 | + WIFI_EVENT_ROAM_SCAN_CONFIG, |
|---|
| 175 | + /* firmware/driver timed out authentication */ |
|---|
| 176 | + WIFI_EVENT_AUTH_TIMEOUT, |
|---|
| 177 | + /* firmware/driver timed out association */ |
|---|
| 178 | + WIFI_EVENT_ASSOC_TIMEOUT, |
|---|
| 179 | + /* firmware/driver encountered allocation failure */ |
|---|
| 180 | + WIFI_EVENT_MEM_ALLOC_FAILURE, |
|---|
| 181 | + /* driver added a PNO network in firmware */ |
|---|
| 182 | + WIFI_EVENT_DRIVER_PNO_ADD, |
|---|
| 183 | + /* driver removed a PNO network in firmware */ |
|---|
| 184 | + WIFI_EVENT_DRIVER_PNO_REMOVE, |
|---|
| 185 | + /* driver received PNO networks found indication from firmware */ |
|---|
| 186 | + WIFI_EVENT_DRIVER_PNO_NETWORK_FOUND, |
|---|
| 187 | + /* driver triggered a scan for PNO networks */ |
|---|
| 188 | + WIFI_EVENT_DRIVER_PNO_SCAN_REQUESTED, |
|---|
| 189 | + /* driver received scan results of PNO networks */ |
|---|
| 190 | + WIFI_EVENT_DRIVER_PNO_SCAN_RESULT_FOUND, |
|---|
| 191 | + /* driver updated scan results from PNO candidates to cfg */ |
|---|
| 192 | + WIFI_EVENT_DRIVER_PNO_SCAN_COMPLETE |
|---|
| 142 | 193 | }; |
|---|
| 143 | 194 | |
|---|
| 144 | 195 | enum { |
|---|
| .. | .. |
|---|
| 158 | 209 | /* take one or more specific 802.11 IEs parameter, IEs are in turn |
|---|
| 159 | 210 | * indicated in TLV format as per 802.11 spec |
|---|
| 160 | 211 | */ |
|---|
| 161 | | - WIFI_TAG_INTERFACE, /* take interface name as parameter */ |
|---|
| 162 | | - WIFI_TAG_REASON_CODE, /* take a reason code as per 802.11 as parameter */ |
|---|
| 163 | | - WIFI_TAG_RATE_MBPS, /* take a wifi rate in 0.5 mbps */ |
|---|
| 212 | + WIFI_TAG_INTERFACE, /* take interface name as parameter */ |
|---|
| 213 | + WIFI_TAG_REASON_CODE, /* take a reason code as per 802.11 as parameter */ |
|---|
| 214 | + WIFI_TAG_RATE_MBPS, /* take a wifi rate in 0.5 mbps */ |
|---|
| 215 | + WIFI_TAG_REQUEST_ID, /* take an integer as parameter */ |
|---|
| 216 | + WIFI_TAG_BUCKET_ID, /* take an integer as parameter */ |
|---|
| 217 | + WIFI_TAG_GSCAN_PARAMS, /* takes a wifi_scan_cmd_params struct as parameter */ |
|---|
| 218 | + WIFI_TAG_GSCAN_CAPABILITIES, /* takes a wifi_gscan_capabilities struct as parameter */ |
|---|
| 219 | + WIFI_TAG_SCAN_ID, /* take an integer as parameter */ |
|---|
| 220 | + WIFI_TAG_RSSI, /* takes s16 as parameter */ |
|---|
| 221 | + WIFI_TAG_CHANNEL, /* takes u16 as parameter */ |
|---|
| 222 | + WIFI_TAG_LINK_ID, /* take an integer as parameter */ |
|---|
| 223 | + WIFI_TAG_LINK_ROLE, /* take an integer as parameter */ |
|---|
| 224 | + WIFI_TAG_LINK_STATE, /* take an integer as parameter */ |
|---|
| 225 | + WIFI_TAG_LINK_TYPE, /* take an integer as parameter */ |
|---|
| 226 | + WIFI_TAG_TSCO, /* take an integer as parameter */ |
|---|
| 227 | + WIFI_TAG_RSCO, /* take an integer as parameter */ |
|---|
| 228 | + WIFI_TAG_EAPOL_MESSAGE_TYPE /* take an integer as parameter */ |
|---|
| 164 | 229 | }; |
|---|
| 165 | 230 | |
|---|
| 166 | 231 | /* NAN events */ |
|---|
| .. | .. |
|---|
| 179 | 244 | typedef struct { |
|---|
| 180 | 245 | uint16 tag; |
|---|
| 181 | 246 | uint16 len; /* length of value */ |
|---|
| 182 | | - uint8 *value; |
|---|
| 247 | + uint8 value[0]; |
|---|
| 183 | 248 | } tlv_log; |
|---|
| 184 | 249 | |
|---|
| 185 | 250 | typedef struct per_packet_status_entry { |
|---|
| .. | .. |
|---|
| 221 | 286 | uint8 *data; |
|---|
| 222 | 287 | } per_packet_status_entry_t; |
|---|
| 223 | 288 | |
|---|
| 289 | +#define PACKED_STRUCT __attribute__ ((packed)) |
|---|
| 290 | + |
|---|
| 224 | 291 | typedef struct log_conn_event { |
|---|
| 225 | 292 | uint16 event; |
|---|
| 226 | 293 | tlv_log *tlvs; |
|---|
| .. | .. |
|---|
| 231 | 298 | * as well, event_data can include a vendor proprietary part which is |
|---|
| 232 | 299 | * understood by the developer only. |
|---|
| 233 | 300 | */ |
|---|
| 234 | | -} log_conn_event_t; |
|---|
| 301 | +} PACKED_STRUCT log_conn_event_t; |
|---|
| 235 | 302 | |
|---|
| 236 | 303 | /* |
|---|
| 237 | 304 | * Ring buffer name for power events ring. note that power event are extremely frequents |
|---|
| .. | .. |
|---|
| 267 | 334 | DBG_RING_ENTRY_NAN_EVENT_TYPE |
|---|
| 268 | 335 | }; |
|---|
| 269 | 336 | |
|---|
| 270 | | -typedef struct dhd_dbg_ring_entry { |
|---|
| 271 | | - uint16 len; /* payload length excluding the header */ |
|---|
| 272 | | - uint8 flags; |
|---|
| 273 | | - uint8 type; /* Per ring specific */ |
|---|
| 274 | | - uint64 timestamp; /* present if has_timestamp bit is set. */ |
|---|
| 275 | | -} dhd_dbg_ring_entry_t; |
|---|
| 276 | | - |
|---|
| 277 | | -#define DBG_RING_ENTRY_SIZE (sizeof(dhd_dbg_ring_entry_t)) |
|---|
| 278 | | -#define ENTRY_LENGTH(hdr) (hdr->len + DBG_RING_ENTRY_SIZE) |
|---|
| 279 | | -typedef struct dhd_dbg_ring_status { |
|---|
| 280 | | - uint8 name[DBGRING_NAME_MAX]; |
|---|
| 281 | | - uint32 flags; |
|---|
| 282 | | - int ring_id; /* unique integer representing the ring */ |
|---|
| 283 | | - /* total memory size allocated for the buffer */ |
|---|
| 284 | | - uint32 ring_buffer_byte_size; |
|---|
| 285 | | - uint32 verbose_level; |
|---|
| 286 | | - /* number of bytes that was written to the buffer by driver */ |
|---|
| 287 | | - uint32 written_bytes; |
|---|
| 288 | | - /* number of bytes that was read from the buffer by user land */ |
|---|
| 289 | | - uint32 read_bytes; |
|---|
| 290 | | - /* number of records that was read from the buffer by user land */ |
|---|
| 291 | | - uint32 written_records; |
|---|
| 292 | | -} dhd_dbg_ring_status_t; |
|---|
| 293 | | - |
|---|
| 294 | 337 | struct log_level_table { |
|---|
| 295 | 338 | int log_level; |
|---|
| 296 | 339 | uint16 tag; |
|---|
| 297 | 340 | char *desc; |
|---|
| 298 | 341 | }; |
|---|
| 299 | 342 | |
|---|
| 300 | | -typedef void (*dbg_pullreq_t)(void *os_priv, const int ring_id); |
|---|
| 301 | | - |
|---|
| 302 | | -typedef void (*dbg_urgent_noti_t) (dhd_pub_t *dhdp, const void *data, const uint32 len); |
|---|
| 303 | | - |
|---|
| 304 | | -#define DBG_EVENT_LOG(dhd, connect_state) \ |
|---|
| 305 | | -{ \ |
|---|
| 343 | +#ifdef OEM_ANDROID |
|---|
| 344 | +/* |
|---|
| 345 | + * Assuming that the Ring lock is mutex, bailing out if the |
|---|
| 346 | + * callers are from atomic context. On a long term, one has to |
|---|
| 347 | + * schedule a job to execute in sleepable context so that |
|---|
| 348 | + * contents are pushed to the ring. |
|---|
| 349 | + */ |
|---|
| 350 | +#define DBG_EVENT_LOG(dhdp, connect_state) \ |
|---|
| 351 | +{ \ |
|---|
| 306 | 352 | do { \ |
|---|
| 307 | | - uint16 state = connect_state; \ |
|---|
| 308 | | - dhd_os_push_push_ring_data(dhd, DHD_EVENT_RING_ID, &state, sizeof(state)); \ |
|---|
| 309 | | - } while (0); \ |
|---|
| 353 | + uint16 state = connect_state; \ |
|---|
| 354 | + if (CAN_SLEEP() && DBG_RING_ACTIVE(dhdp, DHD_EVENT_RING_ID)) \ |
|---|
| 355 | + dhd_os_push_push_ring_data(dhdp, DHD_EVENT_RING_ID, \ |
|---|
| 356 | + &state, sizeof(state)); \ |
|---|
| 357 | + } while (0); \ |
|---|
| 310 | 358 | } |
|---|
| 359 | +#else |
|---|
| 360 | +#define DBG_EVENT_LOG(dhd, connect_state) |
|---|
| 361 | +#endif /* !OEM_ANDROID */ |
|---|
| 362 | + |
|---|
| 363 | +#define MD5_PREFIX_LEN 4 |
|---|
| 364 | +#define MAX_FATE_LOG_LEN 32 |
|---|
| 365 | +#define MAX_FRAME_LEN_ETHERNET 1518 |
|---|
| 366 | +#define MAX_FRAME_LEN_80211_MGMT 2352 /* 802.11-2012 Fig. 8-34 */ |
|---|
| 367 | + |
|---|
| 368 | +typedef enum { |
|---|
| 369 | + /* Sent over air and ACKed. */ |
|---|
| 370 | + TX_PKT_FATE_ACKED, |
|---|
| 371 | + |
|---|
| 372 | + /* Sent over air but not ACKed. (Normal for broadcast/multicast.) */ |
|---|
| 373 | + TX_PKT_FATE_SENT, |
|---|
| 374 | + |
|---|
| 375 | + /* Queued within firmware, but not yet sent over air. */ |
|---|
| 376 | + TX_PKT_FATE_FW_QUEUED, |
|---|
| 377 | + |
|---|
| 378 | + /* |
|---|
| 379 | + * Dropped by firmware as invalid. E.g. bad source address, |
|---|
| 380 | + * bad checksum, or invalid for current state. |
|---|
| 381 | + */ |
|---|
| 382 | + TX_PKT_FATE_FW_DROP_INVALID, |
|---|
| 383 | + |
|---|
| 384 | + /* Dropped by firmware due to lifetime expiration. */ |
|---|
| 385 | + TX_PKT_FATE_FW_DROP_EXPTIME, |
|---|
| 386 | + |
|---|
| 387 | + /* |
|---|
| 388 | + * Dropped by firmware for any other reason. Includes |
|---|
| 389 | + * frames that were sent by driver to firmware, but |
|---|
| 390 | + * unaccounted for by firmware. |
|---|
| 391 | + */ |
|---|
| 392 | + TX_PKT_FATE_FW_DROP_OTHER, |
|---|
| 393 | + |
|---|
| 394 | + /* Queued within driver, not yet sent to firmware. */ |
|---|
| 395 | + TX_PKT_FATE_DRV_QUEUED, |
|---|
| 396 | + |
|---|
| 397 | + /* |
|---|
| 398 | + * Dropped by driver as invalid. E.g. bad source address, |
|---|
| 399 | + * or invalid for current state. |
|---|
| 400 | + */ |
|---|
| 401 | + TX_PKT_FATE_DRV_DROP_INVALID, |
|---|
| 402 | + |
|---|
| 403 | + /* Dropped by driver due to lack of buffer space. */ |
|---|
| 404 | + TX_PKT_FATE_DRV_DROP_NOBUFS, |
|---|
| 405 | + |
|---|
| 406 | + /* Dropped by driver for any other reason. */ |
|---|
| 407 | + TX_PKT_FATE_DRV_DROP_OTHER, |
|---|
| 408 | + |
|---|
| 409 | + /* Packet free by firmware. */ |
|---|
| 410 | + TX_PKT_FATE_FW_PKT_FREE, |
|---|
| 411 | + |
|---|
| 412 | + } wifi_tx_packet_fate; |
|---|
| 413 | + |
|---|
| 414 | +typedef enum { |
|---|
| 415 | + /* Valid and delivered to network stack (e.g., netif_rx()). */ |
|---|
| 416 | + RX_PKT_FATE_SUCCESS, |
|---|
| 417 | + |
|---|
| 418 | + /* Queued within firmware, but not yet sent to driver. */ |
|---|
| 419 | + RX_PKT_FATE_FW_QUEUED, |
|---|
| 420 | + |
|---|
| 421 | + /* Dropped by firmware due to host-programmable filters. */ |
|---|
| 422 | + RX_PKT_FATE_FW_DROP_FILTER, |
|---|
| 423 | + |
|---|
| 424 | + /* |
|---|
| 425 | + * Dropped by firmware as invalid. E.g. bad checksum, |
|---|
| 426 | + * decrypt failed, or invalid for current state. |
|---|
| 427 | + */ |
|---|
| 428 | + RX_PKT_FATE_FW_DROP_INVALID, |
|---|
| 429 | + |
|---|
| 430 | + /* Dropped by firmware due to lack of buffer space. */ |
|---|
| 431 | + RX_PKT_FATE_FW_DROP_NOBUFS, |
|---|
| 432 | + |
|---|
| 433 | + /* Dropped by firmware for any other reason. */ |
|---|
| 434 | + RX_PKT_FATE_FW_DROP_OTHER, |
|---|
| 435 | + |
|---|
| 436 | + /* Queued within driver, not yet delivered to network stack. */ |
|---|
| 437 | + RX_PKT_FATE_DRV_QUEUED, |
|---|
| 438 | + |
|---|
| 439 | + /* Dropped by driver due to filter rules. */ |
|---|
| 440 | + RX_PKT_FATE_DRV_DROP_FILTER, |
|---|
| 441 | + |
|---|
| 442 | + /* Dropped by driver as invalid. E.g. not permitted in current state. */ |
|---|
| 443 | + RX_PKT_FATE_DRV_DROP_INVALID, |
|---|
| 444 | + |
|---|
| 445 | + /* Dropped by driver due to lack of buffer space. */ |
|---|
| 446 | + RX_PKT_FATE_DRV_DROP_NOBUFS, |
|---|
| 447 | + |
|---|
| 448 | + /* Dropped by driver for any other reason. */ |
|---|
| 449 | + RX_PKT_FATE_DRV_DROP_OTHER, |
|---|
| 450 | + |
|---|
| 451 | + } wifi_rx_packet_fate; |
|---|
| 452 | + |
|---|
| 453 | +typedef enum { |
|---|
| 454 | + FRAME_TYPE_UNKNOWN, |
|---|
| 455 | + FRAME_TYPE_ETHERNET_II, |
|---|
| 456 | + FRAME_TYPE_80211_MGMT, |
|---|
| 457 | + } frame_type; |
|---|
| 458 | + |
|---|
| 459 | +typedef struct wifi_frame_info { |
|---|
| 460 | + /* |
|---|
| 461 | + * The type of MAC-layer frame that this frame_info holds. |
|---|
| 462 | + * - For data frames, use FRAME_TYPE_ETHERNET_II. |
|---|
| 463 | + * - For management frames, use FRAME_TYPE_80211_MGMT. |
|---|
| 464 | + * - If the type of the frame is unknown, use FRAME_TYPE_UNKNOWN. |
|---|
| 465 | + */ |
|---|
| 466 | + frame_type payload_type; |
|---|
| 467 | + |
|---|
| 468 | + /* |
|---|
| 469 | + * The number of bytes included in |frame_content|. If the frame |
|---|
| 470 | + * contents are missing (e.g. RX frame dropped in firmware), |
|---|
| 471 | + * |frame_len| should be set to 0. |
|---|
| 472 | + */ |
|---|
| 473 | + size_t frame_len; |
|---|
| 474 | + |
|---|
| 475 | + /* |
|---|
| 476 | + * Host clock when this frame was received by the driver (either |
|---|
| 477 | + * outbound from the host network stack, or inbound from the |
|---|
| 478 | + * firmware). |
|---|
| 479 | + * - The timestamp should be taken from a clock which includes time |
|---|
| 480 | + * the host spent suspended (e.g. ktime_get_boottime()). |
|---|
| 481 | + * - If no host timestamp is available (e.g. RX frame was dropped in |
|---|
| 482 | + * firmware), this field should be set to 0. |
|---|
| 483 | + */ |
|---|
| 484 | + uint32 driver_timestamp_usec; |
|---|
| 485 | + |
|---|
| 486 | + /* |
|---|
| 487 | + * Firmware clock when this frame was received by the firmware |
|---|
| 488 | + * (either outbound from the host, or inbound from a remote |
|---|
| 489 | + * station). |
|---|
| 490 | + * - The timestamp should be taken from a clock which includes time |
|---|
| 491 | + * firmware spent suspended (if applicable). |
|---|
| 492 | + * - If no firmware timestamp is available (e.g. TX frame was |
|---|
| 493 | + * dropped by driver), this field should be set to 0. |
|---|
| 494 | + * - Consumers of |frame_info| should _not_ assume any |
|---|
| 495 | + * synchronization between driver and firmware clocks. |
|---|
| 496 | + */ |
|---|
| 497 | + uint32 firmware_timestamp_usec; |
|---|
| 498 | + |
|---|
| 499 | + /* |
|---|
| 500 | + * Actual frame content. |
|---|
| 501 | + * - Should be provided for TX frames originated by the host. |
|---|
| 502 | + * - Should be provided for RX frames received by the driver. |
|---|
| 503 | + * - Optionally provided for TX frames originated by firmware. (At |
|---|
| 504 | + * discretion of HAL implementation.) |
|---|
| 505 | + * - Optionally provided for RX frames dropped in firmware. (At |
|---|
| 506 | + * discretion of HAL implementation.) |
|---|
| 507 | + * - If frame content is not provided, |frame_len| should be set |
|---|
| 508 | + * to 0. |
|---|
| 509 | + */ |
|---|
| 510 | + union { |
|---|
| 511 | + char ethernet_ii[MAX_FRAME_LEN_ETHERNET]; |
|---|
| 512 | + char ieee_80211_mgmt[MAX_FRAME_LEN_80211_MGMT]; |
|---|
| 513 | + } frame_content; |
|---|
| 514 | +} wifi_frame_info_t; |
|---|
| 515 | + |
|---|
| 516 | +typedef struct wifi_tx_report { |
|---|
| 517 | + /* |
|---|
| 518 | + * Prefix of MD5 hash of |frame_inf.frame_content|. If frame |
|---|
| 519 | + * content is not provided, prefix of MD5 hash over the same data |
|---|
| 520 | + * that would be in frame_content, if frame content were provided. |
|---|
| 521 | + */ |
|---|
| 522 | + char md5_prefix[MD5_PREFIX_LEN]; |
|---|
| 523 | + wifi_tx_packet_fate fate; |
|---|
| 524 | + wifi_frame_info_t frame_inf; |
|---|
| 525 | +} wifi_tx_report_t; |
|---|
| 526 | + |
|---|
| 527 | +typedef struct wifi_rx_report { |
|---|
| 528 | + /* |
|---|
| 529 | + * Prefix of MD5 hash of |frame_inf.frame_content|. If frame |
|---|
| 530 | + * content is not provided, prefix of MD5 hash over the same data |
|---|
| 531 | + * that would be in frame_content, if frame content were provided. |
|---|
| 532 | + */ |
|---|
| 533 | + char md5_prefix[MD5_PREFIX_LEN]; |
|---|
| 534 | + wifi_rx_packet_fate fate; |
|---|
| 535 | + wifi_frame_info_t frame_inf; |
|---|
| 536 | +} wifi_rx_report_t; |
|---|
| 537 | + |
|---|
| 538 | +typedef struct compat_wifi_frame_info { |
|---|
| 539 | + frame_type payload_type; |
|---|
| 540 | + |
|---|
| 541 | + uint32 frame_len; |
|---|
| 542 | + |
|---|
| 543 | + uint32 driver_timestamp_usec; |
|---|
| 544 | + |
|---|
| 545 | + uint32 firmware_timestamp_usec; |
|---|
| 546 | + |
|---|
| 547 | + union { |
|---|
| 548 | + char ethernet_ii[MAX_FRAME_LEN_ETHERNET]; |
|---|
| 549 | + char ieee_80211_mgmt[MAX_FRAME_LEN_80211_MGMT]; |
|---|
| 550 | + } frame_content; |
|---|
| 551 | +} compat_wifi_frame_info_t; |
|---|
| 552 | + |
|---|
| 553 | +typedef struct compat_wifi_tx_report { |
|---|
| 554 | + char md5_prefix[MD5_PREFIX_LEN]; |
|---|
| 555 | + wifi_tx_packet_fate fate; |
|---|
| 556 | + compat_wifi_frame_info_t frame_inf; |
|---|
| 557 | +} compat_wifi_tx_report_t; |
|---|
| 558 | + |
|---|
| 559 | +typedef struct compat_wifi_rx_report { |
|---|
| 560 | + char md5_prefix[MD5_PREFIX_LEN]; |
|---|
| 561 | + wifi_rx_packet_fate fate; |
|---|
| 562 | + compat_wifi_frame_info_t frame_inf; |
|---|
| 563 | +} compat_wifi_rx_report_t; |
|---|
| 564 | + |
|---|
| 565 | +/* |
|---|
| 566 | + * Packet logging - internal data |
|---|
| 567 | + */ |
|---|
| 568 | + |
|---|
| 569 | +typedef enum dhd_dbg_pkt_mon_state { |
|---|
| 570 | + PKT_MON_INVALID = 0, |
|---|
| 571 | + PKT_MON_ATTACHED, |
|---|
| 572 | + PKT_MON_STARTING, |
|---|
| 573 | + PKT_MON_STARTED, |
|---|
| 574 | + PKT_MON_STOPPING, |
|---|
| 575 | + PKT_MON_STOPPED, |
|---|
| 576 | + PKT_MON_DETACHED, |
|---|
| 577 | + } dhd_dbg_pkt_mon_state_t; |
|---|
| 578 | + |
|---|
| 579 | +typedef struct dhd_dbg_pkt_info { |
|---|
| 580 | + frame_type payload_type; |
|---|
| 581 | + size_t pkt_len; |
|---|
| 582 | + uint32 driver_ts; |
|---|
| 583 | + uint32 firmware_ts; |
|---|
| 584 | + uint32 pkt_hash; |
|---|
| 585 | + void *pkt; |
|---|
| 586 | +} dhd_dbg_pkt_info_t; |
|---|
| 587 | + |
|---|
| 588 | +typedef struct compat_dhd_dbg_pkt_info { |
|---|
| 589 | + frame_type payload_type; |
|---|
| 590 | + uint32 pkt_len; |
|---|
| 591 | + uint32 driver_ts; |
|---|
| 592 | + uint32 firmware_ts; |
|---|
| 593 | + uint32 pkt_hash; |
|---|
| 594 | + void *pkt; |
|---|
| 595 | +} compat_dhd_dbg_pkt_info_t; |
|---|
| 596 | + |
|---|
| 597 | +typedef struct dhd_dbg_tx_info |
|---|
| 598 | +{ |
|---|
| 599 | + wifi_tx_packet_fate fate; |
|---|
| 600 | + dhd_dbg_pkt_info_t info; |
|---|
| 601 | +} dhd_dbg_tx_info_t; |
|---|
| 602 | + |
|---|
| 603 | +typedef struct dhd_dbg_rx_info |
|---|
| 604 | +{ |
|---|
| 605 | + wifi_rx_packet_fate fate; |
|---|
| 606 | + dhd_dbg_pkt_info_t info; |
|---|
| 607 | +} dhd_dbg_rx_info_t; |
|---|
| 608 | + |
|---|
| 609 | +typedef struct dhd_dbg_tx_report |
|---|
| 610 | +{ |
|---|
| 611 | + dhd_dbg_tx_info_t *tx_pkts; |
|---|
| 612 | + uint16 pkt_pos; |
|---|
| 613 | + uint16 status_pos; |
|---|
| 614 | +} dhd_dbg_tx_report_t; |
|---|
| 615 | + |
|---|
| 616 | +typedef struct dhd_dbg_rx_report |
|---|
| 617 | +{ |
|---|
| 618 | + dhd_dbg_rx_info_t *rx_pkts; |
|---|
| 619 | + uint16 pkt_pos; |
|---|
| 620 | +} dhd_dbg_rx_report_t; |
|---|
| 621 | + |
|---|
| 622 | +typedef void (*dbg_pullreq_t)(void *os_priv, const int ring_id); |
|---|
| 623 | +typedef void (*dbg_urgent_noti_t) (dhd_pub_t *dhdp, const void *data, const uint32 len); |
|---|
| 624 | +typedef int (*dbg_mon_tx_pkts_t) (dhd_pub_t *dhdp, void *pkt, uint32 pktid); |
|---|
| 625 | +typedef int (*dbg_mon_tx_status_t) (dhd_pub_t *dhdp, void *pkt, |
|---|
| 626 | + uint32 pktid, uint16 status); |
|---|
| 627 | +typedef int (*dbg_mon_rx_pkts_t) (dhd_pub_t *dhdp, void *pkt); |
|---|
| 628 | + |
|---|
| 629 | +typedef struct dhd_dbg_pkt_mon |
|---|
| 630 | +{ |
|---|
| 631 | + dhd_dbg_tx_report_t *tx_report; |
|---|
| 632 | + dhd_dbg_rx_report_t *rx_report; |
|---|
| 633 | + dhd_dbg_pkt_mon_state_t tx_pkt_state; |
|---|
| 634 | + dhd_dbg_pkt_mon_state_t tx_status_state; |
|---|
| 635 | + dhd_dbg_pkt_mon_state_t rx_pkt_state; |
|---|
| 636 | + |
|---|
| 637 | + /* call backs */ |
|---|
| 638 | + dbg_mon_tx_pkts_t tx_pkt_mon; |
|---|
| 639 | + dbg_mon_tx_status_t tx_status_mon; |
|---|
| 640 | + dbg_mon_rx_pkts_t rx_pkt_mon; |
|---|
| 641 | +} dhd_dbg_pkt_mon_t; |
|---|
| 642 | + |
|---|
| 643 | +typedef struct dhd_dbg { |
|---|
| 644 | + dhd_dbg_ring_t dbg_rings[DEBUG_RING_ID_MAX]; |
|---|
| 645 | + void *private; /* os private_data */ |
|---|
| 646 | + dhd_dbg_pkt_mon_t pkt_mon; |
|---|
| 647 | + void *pkt_mon_lock; /* spin lock for packet monitoring */ |
|---|
| 648 | + dbg_pullreq_t pullreq; |
|---|
| 649 | + dbg_urgent_noti_t urgent_notifier; |
|---|
| 650 | +} dhd_dbg_t; |
|---|
| 651 | + |
|---|
| 652 | +#define PKT_MON_ATTACHED(state) \ |
|---|
| 653 | + (((state) > PKT_MON_INVALID) && ((state) < PKT_MON_DETACHED)) |
|---|
| 654 | +#define PKT_MON_DETACHED(state) \ |
|---|
| 655 | + (((state) == PKT_MON_INVALID) || ((state) == PKT_MON_DETACHED)) |
|---|
| 656 | +#define PKT_MON_STARTED(state) ((state) == PKT_MON_STARTED) |
|---|
| 657 | +#define PKT_MON_STOPPED(state) ((state) == PKT_MON_STOPPED) |
|---|
| 658 | +#define PKT_MON_NOT_OPERATIONAL(state) \ |
|---|
| 659 | + (((state) != PKT_MON_STARTED) && ((state) != PKT_MON_STOPPED)) |
|---|
| 660 | +#define PKT_MON_SAFE_TO_FREE(state) \ |
|---|
| 661 | + (((state) == PKT_MON_STARTING) || ((state) == PKT_MON_STOPPED)) |
|---|
| 662 | +#define PKT_MON_PKT_FULL(pkt_count) ((pkt_count) >= MAX_FATE_LOG_LEN) |
|---|
| 663 | +#define PKT_MON_STATUS_FULL(pkt_count, status_count) \ |
|---|
| 664 | + (((status_count) >= (pkt_count)) || ((status_count) >= MAX_FATE_LOG_LEN)) |
|---|
| 665 | + |
|---|
| 666 | +#ifdef DBG_PKT_MON |
|---|
| 667 | +#define DHD_DBG_PKT_MON_TX(dhdp, pkt, pktid) \ |
|---|
| 668 | + do { \ |
|---|
| 669 | + if ((dhdp) && (dhdp)->dbg && (dhdp)->dbg->pkt_mon.tx_pkt_mon && (pkt)) { \ |
|---|
| 670 | + (dhdp)->dbg->pkt_mon.tx_pkt_mon((dhdp), (pkt), (pktid)); \ |
|---|
| 671 | + } \ |
|---|
| 672 | + } while (0); |
|---|
| 673 | +#define DHD_DBG_PKT_MON_TX_STATUS(dhdp, pkt, pktid, status) \ |
|---|
| 674 | + do { \ |
|---|
| 675 | + if ((dhdp) && (dhdp)->dbg && (dhdp)->dbg->pkt_mon.tx_status_mon && (pkt)) { \ |
|---|
| 676 | + (dhdp)->dbg->pkt_mon.tx_status_mon((dhdp), (pkt), (pktid), (status)); \ |
|---|
| 677 | + } \ |
|---|
| 678 | + } while (0); |
|---|
| 679 | +#define DHD_DBG_PKT_MON_RX(dhdp, pkt) \ |
|---|
| 680 | + do { \ |
|---|
| 681 | + if ((dhdp) && (dhdp)->dbg && (dhdp)->dbg->pkt_mon.rx_pkt_mon && (pkt)) { \ |
|---|
| 682 | + if (ntoh16((pkt)->protocol) != ETHER_TYPE_BRCM) { \ |
|---|
| 683 | + (dhdp)->dbg->pkt_mon.rx_pkt_mon((dhdp), (pkt)); \ |
|---|
| 684 | + } \ |
|---|
| 685 | + } \ |
|---|
| 686 | + } while (0); |
|---|
| 687 | + |
|---|
| 688 | +#define DHD_DBG_PKT_MON_START(dhdp) \ |
|---|
| 689 | + dhd_os_dbg_start_pkt_monitor((dhdp)); |
|---|
| 690 | +#define DHD_DBG_PKT_MON_STOP(dhdp) \ |
|---|
| 691 | + dhd_os_dbg_stop_pkt_monitor((dhdp)); |
|---|
| 692 | +#else |
|---|
| 693 | +#define DHD_DBG_PKT_MON_TX(dhdp, pkt, pktid) |
|---|
| 694 | +#define DHD_DBG_PKT_MON_TX_STATUS(dhdp, pkt, pktid, status) |
|---|
| 695 | +#define DHD_DBG_PKT_MON_RX(dhdp, pkt) |
|---|
| 696 | +#define DHD_DBG_PKT_MON_START(dhdp) |
|---|
| 697 | +#define DHD_DBG_PKT_MON_STOP(dhdp) |
|---|
| 698 | +#endif /* DBG_PKT_MON */ |
|---|
| 699 | + |
|---|
| 700 | +#ifdef DUMP_IOCTL_IOV_LIST |
|---|
| 701 | +typedef struct dhd_iov_li { |
|---|
| 702 | + dll_t list; |
|---|
| 703 | + uint32 cmd; /* command number */ |
|---|
| 704 | + char buff[100]; /* command name */ |
|---|
| 705 | +} dhd_iov_li_t; |
|---|
| 706 | +#endif /* DUMP_IOCTL_IOV_LIST */ |
|---|
| 707 | + |
|---|
| 708 | +#define IOV_LIST_MAX_LEN 5 |
|---|
| 709 | + |
|---|
| 710 | +#ifdef DHD_DEBUG |
|---|
| 711 | +typedef struct { |
|---|
| 712 | + dll_t list; |
|---|
| 713 | + uint32 id; /* wasted chunk id */ |
|---|
| 714 | + uint32 handle; /* wasted chunk handle */ |
|---|
| 715 | + uint32 size; /* wasted chunk size */ |
|---|
| 716 | +} dhd_dbg_mwli_t; |
|---|
| 717 | +#endif /* DHD_DEBUG */ |
|---|
| 718 | + |
|---|
| 719 | +#define DHD_OW_BI_RAW_EVENT_LOG_FMT 0xFFFF |
|---|
| 720 | + |
|---|
| 721 | +/* LSB 2 bits of format number to identify the type of event log */ |
|---|
| 722 | +#define DHD_EVENT_LOG_HDR_MASK 0x3 |
|---|
| 723 | + |
|---|
| 724 | +#define DHD_EVENT_LOG_FMT_NUM_OFFSET 2 |
|---|
| 725 | +#define DHD_EVENT_LOG_FMT_NUM_MASK 0x3FFF |
|---|
| 726 | +/** |
|---|
| 727 | + * OW:- one word |
|---|
| 728 | + * TW:- two word |
|---|
| 729 | + * NB:- non binary |
|---|
| 730 | + * BI:- binary |
|---|
| 731 | + */ |
|---|
| 732 | +#define DHD_OW_NB_EVENT_LOG_HDR 0 |
|---|
| 733 | +#define DHD_TW_NB_EVENT_LOG_HDR 1 |
|---|
| 734 | +#define DHD_BI_EVENT_LOG_HDR 3 |
|---|
| 735 | +#define DHD_INVALID_EVENT_LOG_HDR 2 |
|---|
| 736 | + |
|---|
| 737 | +#define DHD_TW_VALID_TAG_BITS_MASK 0xF |
|---|
| 738 | +#define DHD_OW_BI_EVENT_FMT_NUM 0x3FFF |
|---|
| 739 | +#define DHD_TW_BI_EVENT_FMT_NUM 0x3FFE |
|---|
| 740 | + |
|---|
| 741 | +#define DHD_TW_EVENT_LOG_TAG_OFFSET 8 |
|---|
| 742 | + |
|---|
| 743 | +#define EVENT_TAG_TIMESTAMP_OFFSET 1 |
|---|
| 744 | +#define EVENT_TAG_TIMESTAMP_EXT_OFFSET 2 |
|---|
| 745 | + |
|---|
| 746 | +typedef struct prcd_event_log_hdr { |
|---|
| 747 | + uint32 tag; /* Event_log entry tag */ |
|---|
| 748 | + uint32 count; /* Count of 4-byte entries */ |
|---|
| 749 | + uint32 fmt_num_raw; /* Format number */ |
|---|
| 750 | + uint32 fmt_num; /* Format number >> 2 */ |
|---|
| 751 | + uint32 armcycle; /* global ARM CYCLE for TAG */ |
|---|
| 752 | + uint32 *log_ptr; /* start of payload */ |
|---|
| 753 | + uint32 payload_len; |
|---|
| 754 | + /* Extended event log header info |
|---|
| 755 | + * 0 - legacy, 1 - extended event log header present |
|---|
| 756 | + */ |
|---|
| 757 | + bool ext_event_log_hdr; |
|---|
| 758 | + bool binary_payload; /* 0 - non binary payload, 1 - binary payload */ |
|---|
| 759 | +} prcd_event_log_hdr_t; /* Processed event log header */ |
|---|
| 311 | 760 | |
|---|
| 312 | 761 | /* dhd_dbg functions */ |
|---|
| 313 | 762 | extern void dhd_dbg_trace_evnt_handler(dhd_pub_t *dhdp, void *event_data, |
|---|
| 314 | 763 | void *raw_event_ptr, uint datalen); |
|---|
| 764 | +void dhd_dbg_msgtrace_log_parser(dhd_pub_t *dhdp, void *event_data, |
|---|
| 765 | + void *raw_event_ptr, uint datalen, bool msgtrace_hdr_present, |
|---|
| 766 | + uint32 msgtrace_seqnum); |
|---|
| 767 | + |
|---|
| 315 | 768 | extern int dhd_dbg_attach(dhd_pub_t *dhdp, dbg_pullreq_t os_pullreq, |
|---|
| 316 | 769 | dbg_urgent_noti_t os_urgent_notifier, void *os_priv); |
|---|
| 317 | 770 | extern void dhd_dbg_detach(dhd_pub_t *dhdp); |
|---|
| 318 | 771 | extern int dhd_dbg_start(dhd_pub_t *dhdp, bool start); |
|---|
| 319 | 772 | extern int dhd_dbg_set_configuration(dhd_pub_t *dhdp, int ring_id, |
|---|
| 320 | 773 | int log_level, int flags, uint32 threshold); |
|---|
| 321 | | -extern int dhd_dbg_get_ring_status(dhd_pub_t *dhdp, int ring_id, |
|---|
| 322 | | - dhd_dbg_ring_status_t *dbg_ring_status); |
|---|
| 323 | | -extern int dhd_dbg_ring_push(dhd_pub_t *dhdp, int ring_id, dhd_dbg_ring_entry_t *hdr, void *data); |
|---|
| 324 | | -extern int dhd_dbg_ring_pull(dhd_pub_t *dhdp, int ring_id, void *data, uint32 buf_len); |
|---|
| 325 | 774 | extern int dhd_dbg_find_ring_id(dhd_pub_t *dhdp, char *ring_name); |
|---|
| 775 | +extern dhd_dbg_ring_t *dhd_dbg_get_ring_from_ring_id(dhd_pub_t *dhdp, int ring_id); |
|---|
| 326 | 776 | extern void *dhd_dbg_get_priv(dhd_pub_t *dhdp); |
|---|
| 327 | 777 | extern int dhd_dbg_send_urgent_evt(dhd_pub_t *dhdp, const void *data, const uint32 len); |
|---|
| 778 | +extern void dhd_dbg_verboselog_printf(dhd_pub_t *dhdp, prcd_event_log_hdr_t *plog_hdr, |
|---|
| 779 | + void *raw_event_ptr, uint32 *log_ptr, uint32 logset, uint16 block); |
|---|
| 780 | +int dhd_dbg_pull_from_ring(dhd_pub_t *dhdp, int ring_id, void *data, uint32 buf_len); |
|---|
| 781 | +int dhd_dbg_pull_single_from_ring(dhd_pub_t *dhdp, int ring_id, void *data, uint32 buf_len, |
|---|
| 782 | + bool strip_header); |
|---|
| 783 | +int dhd_dbg_push_to_ring(dhd_pub_t *dhdp, int ring_id, dhd_dbg_ring_entry_t *hdr, |
|---|
| 784 | + void *data); |
|---|
| 785 | +int __dhd_dbg_get_ring_status(dhd_dbg_ring_t *ring, dhd_dbg_ring_status_t *ring_status); |
|---|
| 786 | +int dhd_dbg_get_ring_status(dhd_pub_t *dhdp, int ring_id, |
|---|
| 787 | + dhd_dbg_ring_status_t *dbg_ring_status); |
|---|
| 788 | +#ifdef SHOW_LOGTRACE |
|---|
| 789 | +void dhd_dbg_read_ring_into_trace_buf(dhd_dbg_ring_t *ring, trace_buf_info_t *trace_buf_info); |
|---|
| 790 | +#endif /* SHOW_LOGTRACE */ |
|---|
| 791 | + |
|---|
| 792 | +#ifdef DBG_PKT_MON |
|---|
| 793 | +extern int dhd_dbg_attach_pkt_monitor(dhd_pub_t *dhdp, |
|---|
| 794 | + dbg_mon_tx_pkts_t tx_pkt_mon, |
|---|
| 795 | + dbg_mon_tx_status_t tx_status_mon, |
|---|
| 796 | + dbg_mon_rx_pkts_t rx_pkt_mon); |
|---|
| 797 | +extern int dhd_dbg_start_pkt_monitor(dhd_pub_t *dhdp); |
|---|
| 798 | +extern int dhd_dbg_monitor_tx_pkts(dhd_pub_t *dhdp, void *pkt, uint32 pktid); |
|---|
| 799 | +extern int dhd_dbg_monitor_tx_status(dhd_pub_t *dhdp, void *pkt, |
|---|
| 800 | + uint32 pktid, uint16 status); |
|---|
| 801 | +extern int dhd_dbg_monitor_rx_pkts(dhd_pub_t *dhdp, void *pkt); |
|---|
| 802 | +extern int dhd_dbg_stop_pkt_monitor(dhd_pub_t *dhdp); |
|---|
| 803 | +extern int dhd_dbg_monitor_get_tx_pkts(dhd_pub_t *dhdp, void __user *user_buf, |
|---|
| 804 | + uint16 req_count, uint16 *resp_count); |
|---|
| 805 | +extern int dhd_dbg_monitor_get_rx_pkts(dhd_pub_t *dhdp, void __user *user_buf, |
|---|
| 806 | + uint16 req_count, uint16 *resp_count); |
|---|
| 807 | +extern int dhd_dbg_detach_pkt_monitor(dhd_pub_t *dhdp); |
|---|
| 808 | +#endif /* DBG_PKT_MON */ |
|---|
| 809 | + |
|---|
| 810 | +extern bool dhd_dbg_process_tx_status(dhd_pub_t *dhdp, void *pkt, |
|---|
| 811 | + uint32 pktid, uint16 status); |
|---|
| 328 | 812 | |
|---|
| 329 | 813 | /* os wrapper function */ |
|---|
| 330 | 814 | extern int dhd_os_dbg_attach(dhd_pub_t *dhdp); |
|---|
| .. | .. |
|---|
| 346 | 830 | extern int dhd_os_push_push_ring_data(dhd_pub_t *dhdp, int ring_id, void *data, int32 data_len); |
|---|
| 347 | 831 | extern int dhd_os_dbg_get_feature(dhd_pub_t *dhdp, int32 *features); |
|---|
| 348 | 832 | |
|---|
| 833 | +#ifdef DBG_PKT_MON |
|---|
| 834 | +extern int dhd_os_dbg_attach_pkt_monitor(dhd_pub_t *dhdp); |
|---|
| 835 | +extern int dhd_os_dbg_start_pkt_monitor(dhd_pub_t *dhdp); |
|---|
| 836 | +extern int dhd_os_dbg_monitor_tx_pkts(dhd_pub_t *dhdp, void *pkt, |
|---|
| 837 | + uint32 pktid); |
|---|
| 838 | +extern int dhd_os_dbg_monitor_tx_status(dhd_pub_t *dhdp, void *pkt, |
|---|
| 839 | + uint32 pktid, uint16 status); |
|---|
| 840 | +extern int dhd_os_dbg_monitor_rx_pkts(dhd_pub_t *dhdp, void *pkt); |
|---|
| 841 | +extern int dhd_os_dbg_stop_pkt_monitor(dhd_pub_t *dhdp); |
|---|
| 842 | +extern int dhd_os_dbg_monitor_get_tx_pkts(dhd_pub_t *dhdp, |
|---|
| 843 | + void __user *user_buf, uint16 req_count, uint16 *resp_count); |
|---|
| 844 | +extern int dhd_os_dbg_monitor_get_rx_pkts(dhd_pub_t *dhdp, |
|---|
| 845 | + void __user *user_buf, uint16 req_count, uint16 *resp_count); |
|---|
| 846 | +extern int dhd_os_dbg_detach_pkt_monitor(dhd_pub_t *dhdp); |
|---|
| 847 | +#endif /* DBG_PKT_MON */ |
|---|
| 848 | + |
|---|
| 849 | +#ifdef DUMP_IOCTL_IOV_LIST |
|---|
| 850 | +extern void dhd_iov_li_append(dhd_pub_t *dhd, dll_t *list_head, dll_t *node); |
|---|
| 851 | +extern void dhd_iov_li_print(dll_t *list_head); |
|---|
| 852 | +extern void dhd_iov_li_delete(dhd_pub_t *dhd, dll_t *list_head); |
|---|
| 853 | +#endif /* DUMP_IOCTL_IOV_LIST */ |
|---|
| 854 | + |
|---|
| 855 | +#ifdef DHD_DEBUG |
|---|
| 856 | +extern void dhd_mw_list_delete(dhd_pub_t *dhd, dll_t *list_head); |
|---|
| 857 | +#endif /* DHD_DEBUG */ |
|---|
| 349 | 858 | #endif /* _dhd_debug_h_ */ |
|---|