Lines 2301-2307
Link Here
|
2301 |
static void |
2301 |
static void |
2302 |
wpi_debug_registers(struct wpi_softc *sc) |
2302 |
wpi_debug_registers(struct wpi_softc *sc) |
2303 |
{ |
2303 |
{ |
2304 |
#define COUNTOF(array) (sizeof(array) / sizeof(array[0])) |
|
|
2305 |
int i; |
2304 |
int i; |
2306 |
static const uint32_t csr_tbl[] = { |
2305 |
static const uint32_t csr_tbl[] = { |
2307 |
WPI_HW_IF_CONFIG, |
2306 |
WPI_HW_IF_CONFIG, |
Lines 2329-2335
Link Here
|
2329 |
|
2328 |
|
2330 |
DPRINTF(sc, WPI_DEBUG_REGISTER,"%s","\n"); |
2329 |
DPRINTF(sc, WPI_DEBUG_REGISTER,"%s","\n"); |
2331 |
|
2330 |
|
2332 |
for (i = 0; i < COUNTOF(csr_tbl); i++) { |
2331 |
for (i = 0; i < nitems(csr_tbl); i++) { |
2333 |
DPRINTF(sc, WPI_DEBUG_REGISTER, " %-18s: 0x%08x ", |
2332 |
DPRINTF(sc, WPI_DEBUG_REGISTER, " %-18s: 0x%08x ", |
2334 |
wpi_get_csr_string(csr_tbl[i]), WPI_READ(sc, csr_tbl[i])); |
2333 |
wpi_get_csr_string(csr_tbl[i]), WPI_READ(sc, csr_tbl[i])); |
2335 |
|
2334 |
|
Lines 2339-2345
Link Here
|
2339 |
DPRINTF(sc, WPI_DEBUG_REGISTER, "\n\n"); |
2338 |
DPRINTF(sc, WPI_DEBUG_REGISTER, "\n\n"); |
2340 |
|
2339 |
|
2341 |
if (wpi_nic_lock(sc) == 0) { |
2340 |
if (wpi_nic_lock(sc) == 0) { |
2342 |
for (i = 0; i < COUNTOF(prph_tbl); i++) { |
2341 |
for (i = 0; i < nitems(prph_tbl); i++) { |
2343 |
DPRINTF(sc, WPI_DEBUG_REGISTER, " %-18s: 0x%08x ", |
2342 |
DPRINTF(sc, WPI_DEBUG_REGISTER, " %-18s: 0x%08x ", |
2344 |
wpi_get_prph_string(prph_tbl[i]), |
2343 |
wpi_get_prph_string(prph_tbl[i]), |
2345 |
wpi_prph_read(sc, prph_tbl[i])); |
2344 |
wpi_prph_read(sc, prph_tbl[i])); |
Lines 2353-2359
Link Here
|
2353 |
DPRINTF(sc, WPI_DEBUG_REGISTER, |
2352 |
DPRINTF(sc, WPI_DEBUG_REGISTER, |
2354 |
"Cannot access internal registers.\n"); |
2353 |
"Cannot access internal registers.\n"); |
2355 |
} |
2354 |
} |
2356 |
#undef COUNTOF |
|
|
2357 |
} |
2355 |
} |
2358 |
#endif |
2356 |
#endif |
2359 |
|
2357 |
|
Lines 2367-2374
Link Here
|
2367 |
{ |
2365 |
{ |
2368 |
struct wpi_fw_dump dump; |
2366 |
struct wpi_fw_dump dump; |
2369 |
uint32_t i, offset, count; |
2367 |
uint32_t i, offset, count; |
2370 |
const uint32_t size_errmsg = |
|
|
2371 |
(sizeof (wpi_fw_errmsg) / sizeof ((wpi_fw_errmsg)[0])); |
2372 |
|
2368 |
|
2373 |
/* Check that the error log address is valid. */ |
2369 |
/* Check that the error log address is valid. */ |
2374 |
if (sc->errptr < WPI_FW_DATA_BASE || |
2370 |
if (sc->errptr < WPI_FW_DATA_BASE || |
Lines 2398-2404
Link Here
|
2398 |
sizeof (dump) / sizeof (uint32_t)); |
2394 |
sizeof (dump) / sizeof (uint32_t)); |
2399 |
|
2395 |
|
2400 |
printf(" error type = \"%s\" (0x%08X)\n", |
2396 |
printf(" error type = \"%s\" (0x%08X)\n", |
2401 |
(dump.desc < size_errmsg) ? |
2397 |
(dump.desc < nitems(wpi_fw_errmsg)) ? |
2402 |
wpi_fw_errmsg[dump.desc] : "UNKNOWN", |
2398 |
wpi_fw_errmsg[dump.desc] : "UNKNOWN", |
2403 |
dump.desc); |
2399 |
dump.desc); |
2404 |
printf(" error data = 0x%08X\n", |
2400 |
printf(" error data = 0x%08X\n", |