• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Structure used by apps whose drivers access SDIO drivers.
3  * Pulled out separately so dhdu and wlu can both use it.
4  *
5  * Copyright (C) 1999-2017, Broadcom Corporation
6  *
7  *      Unless you and Broadcom execute a separate written software license
8  * agreement governing use of this software, this software is licensed to you
9  * under the terms of the GNU General Public License version 2 (the "GPL"),
10  * available at http://www.broadcom.com/licenses/GPLv2.php, with the
11  * following added to such license:
12  *
13  *      As a special exception, the copyright holders of this software give you
14  * permission to link this software with independent modules, and to copy and
15  * distribute the resulting executable under terms of your choice, provided that
16  * you also meet, for each linked independent module, the terms and conditions of
17  * the license of that module.  An independent module is a module which is not
18  * derived from this software.  The special exception does not apply to any
19  * modifications of the software.
20  *
21  *      Notwithstanding the above, under no circumstances may you combine this
22  * software in any way with any other Broadcom software provided under a license
23  * other than the GPL, without Broadcom's express prior written consent.
24  *
25  *
26  * <<Broadcom-WL-IPTag/Open:>>
27  *
28  * $Id: sdiovar.h 610006 2016-01-06 01:38:47Z $
29  */
30 
31 #ifndef _sdiovar_h_
32 #define _sdiovar_h_
33 
34 #include <typedefs.h>
35 
36 /* require default structure packing */
37 #define BWL_DEFAULT_PACKING
38 #include <packed_section_start.h>
39 
40 typedef struct sdreg {
41     int func;
42     int offset;
43     int value;
44 } sdreg_t;
45 
46 /* Common msglevel constants */
47 #define SDH_ERROR_VAL        0x0001    /* Error */
48 #define SDH_TRACE_VAL        0x0002    /* Trace */
49 #define SDH_INFO_VAL        0x0004    /* Info */
50 #define SDH_DEBUG_VAL        0x0008    /* Debug */
51 #define SDH_DATA_VAL        0x0010    /* Data */
52 #define SDH_CTRL_VAL        0x0020    /* Control Regs */
53 #define SDH_LOG_VAL        0x0040    /* Enable bcmlog */
54 #define SDH_DMA_VAL        0x0080    /* DMA */
55 #define SDH_COST_VAL        0x8000    /* Control Regs */
56 
57 #define NUM_PREV_TRANSACTIONS    16
58 
59 
60 typedef struct sdio_bus_metrics {
61     uint32 active_dur;    /* msecs */
62 
63     /* Generic */
64     uint32 data_intr_cnt;    /* data interrupt counter */
65     uint32 mb_intr_cnt;    /* mailbox interrupt counter */
66     uint32 error_intr_cnt;    /* error interrupt counter */
67     uint32 wakehost_cnt;    /* counter for OOB wakehost */
68 
69     /* DS forcewake */
70     uint32 ds_wake_on_cnt;    /* counter for (clock) ON   */
71     uint32 ds_wake_on_dur;    /* duration for (clock) ON) */
72     uint32 ds_wake_off_cnt;    /* counter for (clock) OFF  */
73     uint32 ds_wake_off_dur;    /* duration for (clock) OFF */
74 
75     /* DS_D0 state */
76     uint32 ds_d0_cnt;    /* counter for DS_D0 state */
77     uint32 ds_d0_dur;    /* duration for DS_D0 state */
78 
79     /* DS_D3 state */
80     uint32 ds_d3_cnt;    /* counter for DS_D3 state */
81     uint32 ds_d3_dur;    /* duration for DS_D3 state */
82 
83     /* DS DEV_WAKE */
84     uint32 ds_dw_assrt_cnt;        /* counter for DW_ASSERT */
85     uint32 ds_dw_dassrt_cnt;    /* counter for DW_DASSERT */
86 
87     /* DS mailbox signals */
88     uint32 ds_tx_dsreq_cnt;        /* counter for tx HMB_DATA_DSREQ */
89     uint32 ds_tx_dsexit_cnt;    /* counter for tx HMB_DATA_DSEXIT */
90     uint32 ds_tx_d3ack_cnt;        /* counter for tx HMB_DATA_D3ACK */
91     uint32 ds_tx_d3exit_cnt;    /* counter for tx HMB_DATA_D3EXIT */
92     uint32 ds_rx_dsack_cnt;        /* counter for rx SMB_DATA_DSACK */
93     uint32 ds_rx_dsnack_cnt;    /* counter for rx SMB_DATA_DSNACK */
94     uint32 ds_rx_d3inform_cnt;    /* counter for rx SMB_DATA_D3INFORM */
95 } sdio_bus_metrics_t;
96 
97 /* Bus interface info for SDIO */
98 typedef struct wl_pwr_sdio_stats {
99     uint16 type;         /* WL_PWRSTATS_TYPE_SDIO */
100     uint16 len;         /* Up to 4K-1, top 4 bits are reserved */
101 
102     sdio_bus_metrics_t sdio;    /* stats from SDIO bus driver */
103 } wl_pwr_sdio_stats_t;
104 
105 #include <packed_section_end.h>
106 
107 #endif /* _sdiovar_h_ */
108