Lines 41-46
Link Here
|
41 |
WPI_DEBUG_EEPROM = 0x00008000, /* EEPROM info */ |
41 |
WPI_DEBUG_EEPROM = 0x00008000, /* EEPROM info */ |
42 |
WPI_DEBUG_KEY = 0x00010000, /* node key management */ |
42 |
WPI_DEBUG_KEY = 0x00010000, /* node key management */ |
43 |
WPI_DEBUG_EDCA = 0x00020000, /* WME info */ |
43 |
WPI_DEBUG_EDCA = 0x00020000, /* WME info */ |
|
|
44 |
WPI_DEBUG_REGISTER = 0x00080000, /* print chipset register */ |
44 |
WPI_DEBUG_ANY = 0xffffffff |
45 |
WPI_DEBUG_ANY = 0xffffffff |
45 |
}; |
46 |
}; |
46 |
|
47 |
|
Lines 54-89
Link Here
|
54 |
#define TRACE_STR_END "->%s: end\n" |
55 |
#define TRACE_STR_END "->%s: end\n" |
55 |
#define TRACE_STR_END_ERR "->%s: end in error\n" |
56 |
#define TRACE_STR_END_ERR "->%s: end in error\n" |
56 |
|
57 |
|
|
|
58 |
#define WPI_DESC(x) case x: return #x |
59 |
|
57 |
static const char *wpi_cmd_str(int cmd) |
60 |
static const char *wpi_cmd_str(int cmd) |
58 |
{ |
61 |
{ |
59 |
switch (cmd) { |
62 |
switch (cmd) { |
60 |
/* Notifications */ |
63 |
/* Notifications. */ |
61 |
case WPI_UC_READY: return "UC_READY"; |
64 |
WPI_DESC(WPI_UC_READY); |
62 |
case WPI_RX_DONE: return "RX_DONE"; |
65 |
WPI_DESC(WPI_RX_DONE); |
63 |
case WPI_START_SCAN: return "START_SCAN"; |
66 |
WPI_DESC(WPI_START_SCAN); |
64 |
case WPI_SCAN_RESULTS: return "SCAN_RESULTS"; |
67 |
WPI_DESC(WPI_SCAN_RESULTS); |
65 |
case WPI_STOP_SCAN: return "STOP_SCAN"; |
68 |
WPI_DESC(WPI_STOP_SCAN); |
66 |
case WPI_BEACON_SENT: return "BEACON_SENT"; |
69 |
WPI_DESC(WPI_BEACON_SENT); |
67 |
case WPI_RX_STATISTICS: return "RX_STATS"; |
70 |
WPI_DESC(WPI_RX_STATISTICS); |
68 |
case WPI_BEACON_STATISTICS: return "BEACON_STATS"; |
71 |
WPI_DESC(WPI_BEACON_STATISTICS); |
69 |
case WPI_STATE_CHANGED: return "STATE_CHANGED"; |
72 |
WPI_DESC(WPI_STATE_CHANGED); |
70 |
case WPI_BEACON_MISSED: return "BEACON_MISSED"; |
73 |
WPI_DESC(WPI_BEACON_MISSED); |
71 |
|
74 |
|
72 |
/* Command notifications */ |
75 |
/* Command notifications. */ |
73 |
case WPI_CMD_RXON: return "WPI_CMD_RXON"; |
76 |
WPI_DESC(WPI_CMD_RXON); |
74 |
case WPI_CMD_RXON_ASSOC: return "WPI_CMD_RXON_ASSOC"; |
77 |
WPI_DESC(WPI_CMD_RXON_ASSOC); |
75 |
case WPI_CMD_EDCA_PARAMS: return "WPI_CMD_EDCA_PARAMS"; |
78 |
WPI_DESC(WPI_CMD_EDCA_PARAMS); |
76 |
case WPI_CMD_TIMING: return "WPI_CMD_TIMING"; |
79 |
WPI_DESC(WPI_CMD_TIMING); |
77 |
case WPI_CMD_ADD_NODE: return "WPI_CMD_ADD_NODE"; |
80 |
WPI_DESC(WPI_CMD_ADD_NODE); |
78 |
case WPI_CMD_DEL_NODE: return "WPI_CMD_DEL_NODE"; |
81 |
WPI_DESC(WPI_CMD_DEL_NODE); |
79 |
case WPI_CMD_TX_DATA: return "WPI_CMD_TX_DATA"; |
82 |
WPI_DESC(WPI_CMD_TX_DATA); |
80 |
case WPI_CMD_MRR_SETUP: return "WPI_CMD_MRR_SETUP"; |
83 |
WPI_DESC(WPI_CMD_MRR_SETUP); |
81 |
case WPI_CMD_SET_LED: return "WPI_CMD_SET_LED"; |
84 |
WPI_DESC(WPI_CMD_SET_LED); |
82 |
case WPI_CMD_SET_POWER_MODE: return "WPI_CMD_SET_POWER_MODE"; |
85 |
WPI_DESC(WPI_CMD_SET_POWER_MODE); |
83 |
case WPI_CMD_SCAN: return "WPI_CMD_SCAN"; |
86 |
WPI_DESC(WPI_CMD_SCAN); |
84 |
case WPI_CMD_SET_BEACON: return "WPI_CMD_SET_BEACON"; |
87 |
WPI_DESC(WPI_CMD_SET_BEACON); |
85 |
case WPI_CMD_TXPOWER: return "WPI_CMD_TXPOWER"; |
88 |
WPI_DESC(WPI_CMD_TXPOWER); |
86 |
case WPI_CMD_BT_COEX: return "WPI_CMD_BT_COEX"; |
89 |
WPI_DESC(WPI_CMD_BT_COEX); |
87 |
|
90 |
|
88 |
default: |
91 |
default: |
89 |
KASSERT(1, ("Unknown Command: %d\n", cmd)); |
92 |
KASSERT(1, ("Unknown Command: %d\n", cmd)); |
Lines 91-96
Link Here
|
91 |
} |
94 |
} |
92 |
} |
95 |
} |
93 |
|
96 |
|
|
|
97 |
/* |
98 |
* Translate CSR code to string |
99 |
*/ |
100 |
static const char *wpi_get_csr_string(int csr) |
101 |
{ |
102 |
switch (csr) { |
103 |
WPI_DESC(WPI_HW_IF_CONFIG); |
104 |
WPI_DESC(WPI_INT); |
105 |
WPI_DESC(WPI_INT_MASK); |
106 |
WPI_DESC(WPI_FH_INT); |
107 |
WPI_DESC(WPI_GPIO_IN); |
108 |
WPI_DESC(WPI_RESET); |
109 |
WPI_DESC(WPI_GP_CNTRL); |
110 |
WPI_DESC(WPI_EEPROM); |
111 |
WPI_DESC(WPI_EEPROM_GP); |
112 |
WPI_DESC(WPI_GIO); |
113 |
WPI_DESC(WPI_UCODE_GP1); |
114 |
WPI_DESC(WPI_UCODE_GP2); |
115 |
WPI_DESC(WPI_GIO_CHICKEN); |
116 |
WPI_DESC(WPI_ANA_PLL); |
117 |
WPI_DESC(WPI_DBG_HPET_MEM); |
118 |
default: |
119 |
KASSERT(1, ("Unknown CSR: %d\n", csr)); |
120 |
return "UNKNOWN CSR"; |
121 |
} |
122 |
} |
123 |
|
124 |
static const char *wpi_get_prph_string(int prph) |
125 |
{ |
126 |
switch (prph) { |
127 |
WPI_DESC(WPI_APMG_CLK_CTRL); |
128 |
WPI_DESC(WPI_APMG_PS); |
129 |
WPI_DESC(WPI_APMG_PCI_STT); |
130 |
WPI_DESC(WPI_APMG_RFKILL); |
131 |
default: |
132 |
KASSERT(1, ("Unknown register: %d\n", prph)); |
133 |
return "UNKNOWN PRPH"; |
134 |
} |
135 |
} |
136 |
|
94 |
#else |
137 |
#else |
95 |
#define DPRINTF(sc, m, ...) do { (void) sc; } while (0) |
138 |
#define DPRINTF(sc, m, ...) do { (void) sc; } while (0) |
96 |
#endif |
139 |
#endif |