49 s32 remaining = *remain;
51 #ifdef CSR_UNSAFE_SDIO_ACCESS
54 static const char *
const states[] = {
55 "AWAKE",
"DROWSY",
"TORPID"
57 #define SHARED_READ_RETRY_LIMIT 10
67 written =
scnprintf(p, remaining,
"Chip ID %u\n",
70 written =
scnprintf(p, remaining,
"Chip Version %04X\n",
73 written =
scnprintf(p, remaining,
"HIP v%u.%u\n",
74 (card->config_data.version >> 8) & 0xFF,
75 card->config_data.version & 0xFF);
77 written =
scnprintf(p, remaining,
"Build %u: %s\n",
78 card->build_id, card->build_id_string);
81 cfg = &card->config_data;
83 written =
scnprintf(p, remaining,
"sdio ctrl offset %u\n",
86 written =
scnprintf(p, remaining,
"fromhost sigbuf handle %u\n",
89 written =
scnprintf(p, remaining,
"tohost_sigbuf_handle %u\n",
92 written =
scnprintf(p, remaining,
"num_fromhost_sig_frags %u\n",
95 written =
scnprintf(p, remaining,
"num_tohost_sig_frags %u\n",
98 written =
scnprintf(p, remaining,
"num_fromhost_data_slots %u\n",
101 written =
scnprintf(p, remaining,
"num_tohost_data_slots %u\n",
104 written =
scnprintf(p, remaining,
"data_slot_size %u\n",
109 written =
scnprintf(p, remaining,
"overlay_size %u\n",
114 written =
scnprintf(p, remaining,
"data_slot_round %u\n",
117 written =
scnprintf(p, remaining,
"sig_frag_size %u\n",
122 written =
scnprintf(p, remaining,
"tohost_sig_pad %u\n",
126 written =
scnprintf(p, remaining,
"\nInternal state:\n");
129 written =
scnprintf(p, remaining,
"Last PHY PANIC: %04x:%04x\n",
130 card->last_phy_panic_code, card->last_phy_panic_arg);
132 written =
scnprintf(p, remaining,
"Last MAC PANIC: %04x:%04x\n",
133 card->last_mac_panic_code, card->last_mac_panic_arg);
136 written =
scnprintf(p, remaining,
"fhsr: %u\n",
137 (
u16)card->from_host_signals_r);
139 written =
scnprintf(p, remaining,
"fhsw: %u\n",
140 (
u16)card->from_host_signals_w);
142 written =
scnprintf(p, remaining,
"thsr: %u\n",
143 (
u16)card->to_host_signals_r);
145 written =
scnprintf(p, remaining,
"thsw: %u\n",
146 (
u16)card->to_host_signals_w);
149 "fh buffer contains: %d signals, %td bytes\n",
150 card->fh_buffer.count,
151 card->fh_buffer.ptr - card->fh_buffer.buf);
154 written =
scnprintf(p, remaining,
"paused: ");
156 for (i = 0; i <
sizeof(card->tx_q_paused_flag) /
sizeof(card->tx_q_paused_flag[0]); i++)
158 written =
scnprintf(p, remaining, card->tx_q_paused_flag[i]?
"1" :
"0");
165 "fh command q: %u waiting, %u free of %u:\n",
173 "fh traffic q[%u]: %u waiting, %u free of %u:\n",
181 written =
scnprintf(p, remaining,
"fh data slots free: %u\n",
186 written =
scnprintf(p, remaining,
"From host data slots:");
188 n = card->config_data.num_fromhost_data_slots;
189 for (i = 0; i < n && card->from_host_data; i++)
192 (
u16)card->from_host_data[i].bd.data_length);
198 written =
scnprintf(p, remaining,
"To host data slots:");
200 n = card->config_data.num_tohost_data_slots;
201 for (i = 0; i < n && card->to_host_data; i++)
204 (
u16)card->to_host_data[i].data_length);
211 #ifdef CSR_UNSAFE_SDIO_ACCESS
212 written =
scnprintf(p, remaining,
"Host State: %s\n", states[card->host_state]);
218 written =
scnprintf(p, remaining,
"I/O Check: F1 disabled\n");
225 written =
scnprintf(p, remaining,
"I/O Check: pending interrupt\n");
229 written =
scnprintf(p, remaining,
"BH reason interrupt = %d\n",
230 card->bh_reason_unifi);
232 written =
scnprintf(p, remaining,
"BH reason host = %d\n",
233 card->bh_reason_host);
241 written =
scnprintf(p, remaining,
"fhsr: %u (driver thinks is %u)\n",
242 b, card->from_host_signals_r);
248 written =
scnprintf(p, remaining,
"thsw: %u (driver thinks is %u)\n",
249 iostate, card->to_host_signals_w);
254 written =
scnprintf(p, remaining,
"\nStats:\n");
256 written =
scnprintf(p, remaining,
"Total SDIO bytes: R=%u W=%u\n",
257 card->sdio_bytes_read, card->sdio_bytes_written);
260 written =
scnprintf(p, remaining,
"Interrupts generated on card: %u\n",
261 card->unifi_interrupt_seq);