When debugging CIS, only print 10 CISTPL_NULLs. Chances are good they

are all bogus, and the cards that don't decode things quite right
often have hundreds of them.  This will fix starvation of small dmesg
buffers and allow better debugging to happen.  I thought about adding
an override, but there is such a thing as too many knobs. :-)
This commit is contained in:
Warner Losh 2003-08-20 05:44:55 +00:00
parent 45cc9f5f4f
commit 82d2e53a57
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=119161

View file

@ -52,8 +52,8 @@ extern int pccard_cis_debug;
#define PCCARDCISDEBUG
#ifdef PCCARDCISDEBUG
#define DPRINTF(arg) if (pccard_cis_debug) printf arg
#define DEVPRINTF(arg) if (pccard_cis_debug) device_printf arg
#define DPRINTF(arg) do { if (pccard_cis_debug) printf arg; } while (0)
#define DEVPRINTF(arg) do { if (pccard_cis_debug) device_printf arg; } while (0)
#else
#define DPRINTF(arg)
#define DEVPRINTF(arg)
@ -112,6 +112,9 @@ pccard_scan_cis(device_t dev, int (*fct)(struct pccard_tuple *, void *),
u_long longlink_addr; /* Type suspect */
int mfc_count;
int mfc_index;
#ifdef PCCARDCISDEBUG
int cis_none_cnt = 10; /* Only report 10 CIS_NONEs */
#endif
struct {
int common;
u_long addr;
@ -169,7 +172,13 @@ pccard_scan_cis(device_t dev, int (*fct)(struct pccard_tuple *, void *),
/* two special-case tuples */
if (tuple.code == PCCARD_CISTPL_NULL) {
#ifdef PCCARDCISDEBUG
if (cis_none_cnt > 0)
DPRINTF(("CISTPL_NONE\n 00\n"));
else if (cis_none_cnt == 0)
DPRINTF(("TOO MANY CIS_NONE\n"));
cis_none_cnt--;
#endif
tuple.ptr++;
continue;
} else if (tuple.code == PCCARD_CISTPL_END) {