mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-17 10:26:15 +00:00
Implement hw.cardbus.debug and hw.cardbus.cis_debug to help debug some
of the cardbus problems that people may start seeing.
This commit is contained in:
parent
7cdb5c5ec4
commit
b3889b6815
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=91787
@ -36,12 +36,11 @@
|
||||
* Written by Jonathan Chen <jon@freebsd.org>
|
||||
*/
|
||||
|
||||
#define CARDBUS_DEBUG
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/malloc.h>
|
||||
#include <sys/kernel.h>
|
||||
#include <sys/sysctl.h>
|
||||
|
||||
#include <sys/bus.h>
|
||||
#include <machine/bus.h>
|
||||
@ -61,18 +60,25 @@
|
||||
#include "card_if.h"
|
||||
#include "pcib_if.h"
|
||||
|
||||
#if defined CARDBUS_DEBUG
|
||||
#define DPRINTF(a) printf a
|
||||
#define DEVPRINTF(x) device_printf x
|
||||
#else
|
||||
#define DPRINTF(a)
|
||||
#define DEVPRINTF(x)
|
||||
#endif
|
||||
__FBSDID("$FreeBSD$");
|
||||
|
||||
#if !defined(lint)
|
||||
static const char rcsid[] =
|
||||
"$FreeBSD$";
|
||||
#endif
|
||||
/* sysctl vars */
|
||||
SYSCTL_NODE(_hw, OID_AUTO, cardbus, CTLFLAG_RD, 0, "CardBus parameters");
|
||||
|
||||
int cardbus_debug = 0;
|
||||
TUNABLE_INT("hw.cardbus.debug", &cardbus_debug);
|
||||
SYSCTL_INT(_hw_cardbus, OID_AUTO, debug, CTLFLAG_RW,
|
||||
&cardbus_debug, 0,
|
||||
"CardBus debug");
|
||||
|
||||
int cardbus_cis_debug = 0;
|
||||
TUNABLE_INT("hw.cardbus.cis_debug", &cardbus_cis_debug);
|
||||
SYSCTL_INT(_hw_cardbus, OID_AUTO, cis_debug, CTLFLAG_RW,
|
||||
&cardbus_cis_debug, 0,
|
||||
"CardBus CIS debug");
|
||||
|
||||
#define DPRINTF(a) if (cardbus_debug) printf a
|
||||
#define DEVPRINTF(x) if (cardbus_debug) device_printf x
|
||||
|
||||
static int cardbus_probe(device_t cbdev);
|
||||
static int cardbus_attach(device_t cbdev);
|
||||
|
@ -32,8 +32,6 @@
|
||||
* CIS Handling for the Cardbus Bus
|
||||
*/
|
||||
|
||||
#define CARDBUS_DEBUG
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/kernel.h>
|
||||
@ -54,16 +52,13 @@
|
||||
|
||||
#include "card_if.h"
|
||||
|
||||
#if defined CARDBUS_DEBUG
|
||||
#define DPRINTF(a) printf a
|
||||
#define DEVPRINTF(x) device_printf x
|
||||
#else
|
||||
#define DPRINTF(a)
|
||||
#define DEVPRINTF(x)
|
||||
#endif
|
||||
|
||||
__FBSDID("$FreeBSD$");
|
||||
|
||||
extern int cardbus_cis_debug;
|
||||
|
||||
#define DPRINTF(a) if (cardbus_cis_debug) printf a
|
||||
#define DEVPRINTF(x) if (cardbus_cis_debug) device_printf x
|
||||
|
||||
#define DECODE_PARAMS \
|
||||
(device_t cbdev, device_t child, int id, int len, \
|
||||
u_int8_t *tupledata, u_int32_t start, u_int32_t *off, \
|
||||
|
Loading…
Reference in New Issue
Block a user