Replace the FOO_DEBUG definitions with USB_DEBUG, and switch the

debugging levels to off by default.  Now that debug levels can be
tweaked by sysctl we don't need to go through hoops to get the
different usb parts to produce debug data.
This commit is contained in:
joe 2002-07-31 14:34:36 +00:00
parent 30e05fdd50
commit 697007c0e1
23 changed files with 110 additions and 174 deletions

View File

@ -86,7 +86,7 @@
#include <dev/sound/usb/uaudioreg.h>
#include <dev/sound/usb/uaudio.h>
#ifdef UAUDIO_DEBUG
#ifdef USB_DEBUG
#define DPRINTF(x) if (uaudiodebug) logprintf x
#define DPRINTFN(n,x) if (uaudiodebug>(n)) logprintf x
int uaudiodebug = 0;
@ -479,7 +479,7 @@ USB_ATTACH(uaudio)
if (usbd_get_quirks(sc->sc_udev)->uq_flags & UQ_AU_NO_FRAC)
sc->sc_chan.nofrac = 1;
#ifndef UAUDIO_DEBUG
#ifndef USB_DEBUG
if (bootverbose)
#endif
printf("%s: %d mixer controls\n", USBDEVNAME(sc->sc_dev),
@ -691,7 +691,7 @@ uaudio_mixer_add_ctl(struct uaudio_softc *sc, struct mixerctl *mc)
sc->sc_ctls[sc->sc_nctls++] = *mc;
#ifdef UAUDIO_DEBUG
#ifdef USB_DEBUG
if (uaudiodebug > 2) {
int i;
DPRINTF(("uaudio_mixer_add_ctl: wValue=%04x",mc->wValue[0]));
@ -790,7 +790,7 @@ void
uaudio_add_input(struct uaudio_softc *sc, usb_descriptor_t *v,
usb_descriptor_t **dps)
{
#ifdef UAUDIO_DEBUG
#ifdef USB_DEBUG
struct usb_audio_input_terminal *d =
(struct usb_audio_input_terminal *)v;
@ -807,7 +807,7 @@ void
uaudio_add_output(struct uaudio_softc *sc, usb_descriptor_t *v,
usb_descriptor_t **dps)
{
#ifdef UAUDIO_DEBUG
#ifdef USB_DEBUG
struct usb_audio_output_terminal *d =
(struct usb_audio_output_terminal *)v;
@ -893,7 +893,7 @@ void
uaudio_add_selector(struct uaudio_softc *sc, usb_descriptor_t *v,
usb_descriptor_t **dps)
{
#ifdef UAUDIO_DEBUG
#ifdef USB_DEBUG
struct usb_audio_selector_unit *d =
(struct usb_audio_selector_unit *)v;
@ -1152,7 +1152,7 @@ uaudio_add_processing(struct uaudio_softc *sc, usb_descriptor_t *v,
case CHORUS_PROCESS:
case DYN_RANGE_COMP_PROCESS:
default:
#ifdef UAUDIO_DEBUG
#ifdef USB_DEBUG
printf("uaudio_add_processing: unit %d, type=%d not impl.\n",
d->bUnitId, ptype);
#endif
@ -1298,7 +1298,7 @@ uaudio_process_as(struct uaudio_softc *sc, char *buf, int *offsp,
chan = asf1d->bNrChannels;
prec = asf1d->bBitResolution;
if (prec != 8 && prec != 16) {
#ifdef UAUDIO_DEBUG
#ifdef USB_DEBUG
printf("%s: ignored setting with precision %d\n",
USBDEVNAME(sc->sc_dev), prec);
#endif
@ -1374,7 +1374,7 @@ uaudio_identify_as(struct uaudio_softc *sc, usb_config_descriptor_t *cdesc)
err = uaudio_process_as(sc, buf, &offs, size, id);
break;
default:
#ifdef UAUDIO_DEBUG
#ifdef USB_DEBUG
printf("%s: ignored audio interface with %d "
"endpoints\n",
USBDEVNAME(sc->sc_dev), id->bNumEndpoints);
@ -1785,7 +1785,7 @@ uaudio_set(struct uaudio_softc *sc, int which, int type, int wValue,
"wIndex=0x%04x len=%d, val=%d\n",
type, which, wValue, wIndex, len, val & 0xffff));
err = usbd_do_request(sc->sc_udev, &req, &data);
#ifdef UAUDIO_DEBUG
#ifdef USB_DEBUG
if (err)
DPRINTF(("uaudio_set: err=%d\n", err));
#endif
@ -2039,7 +2039,7 @@ uaudio_chan_open(struct uaudio_softc *sc, struct chan *ch)
return (err);
/* Some devices do not support this request, so ignore errors. */
#ifdef UAUDIO_DEBUG
#ifdef USB_DEBUG
err = uaudio_set_speed(sc, endpt, ch->sample_rate);
if (err)
DPRINTF(("uaudio_chan_open: set_speed failed err=%s\n",
@ -2157,7 +2157,7 @@ uaudio_chan_ptransfer(struct chan *ch)
ch->cur += total;
}
#ifdef UAUDIO_DEBUG
#ifdef USB_DEBUG
if (uaudiodebug > 8) {
DPRINTF(("uaudio_chan_ptransfer: buffer=%p, residue=0.%03d\n",
cb->buffer, ch->residue));
@ -2253,7 +2253,7 @@ uaudio_chan_rtransfer(struct chan *ch)
ch->residue = residue;
cb->size = total;
#ifdef UAUDIO_DEBUG
#ifdef USB_DEBUG
if (uaudiodebug > 8) {
DPRINTF(("uaudio_chan_rtransfer: buffer=%p, residue=0.%03d\n",
cb->buffer, ch->residue));

View File

@ -50,7 +50,7 @@
#include <dev/usb/hid.h>
#ifdef UHID_DEBUG
#ifdef USB_DEBUG
#define DPRINTF(x) if (usbdebug) logprintf x
#define DPRINTFN(n,x) if (usbdebug>(n)) logprintf x
extern int usbdebug;

View File

@ -90,7 +90,7 @@ struct cfdriver ohci_cd = {
};
#endif
#ifdef OHCI_DEBUG
#ifdef USB_DEBUG
#define DPRINTF(x) if (ohcidebug) logprintf x
#define DPRINTFN(n,x) if (ohcidebug>(n)) logprintf x
int ohcidebug = 0;
@ -219,7 +219,7 @@ Static void ohci_abort_xfer(usbd_xfer_handle, usbd_status);
Static void ohci_device_clear_toggle(usbd_pipe_handle pipe);
Static void ohci_noop(usbd_pipe_handle pipe);
#ifdef OHCI_DEBUG
#ifdef USB_DEBUG
Static void ohci_dumpregs(ohci_softc_t *);
Static void ohci_dump_tds(ohci_soft_td_t *);
Static void ohci_dump_td(ohci_soft_td_t *);
@ -762,7 +762,7 @@ ohci_init(ohci_softc_t *sc)
sc->sc_hcca->hcca_interrupt_table[revbits[i]] =
htole32(sc->sc_eds[OHCI_NO_EDS-OHCI_NO_INTRS+i]->physaddr);
#ifdef OHCI_DEBUG
#ifdef USB_DEBUG
if (ohcidebug > 15) {
for (i = 0; i < OHCI_NO_EDS; i++) {
printf("ed#%d ", i);
@ -831,7 +831,7 @@ ohci_init(ohci_softc_t *sc)
err = USBD_IOERROR;
goto bad5;
}
#ifdef OHCI_DEBUG
#ifdef USB_DEBUG
if (ohcidebug > 15)
ohci_dumpregs(sc);
#endif
@ -878,7 +878,7 @@ ohci_init(ohci_softc_t *sc)
usb_delay_ms(&sc->sc_bus, OHCI_READ_DESC_DELAY);
sc->sc_noport = OHCI_GET_NDP(OREAD4(sc, OHCI_RH_DESCRIPTOR_A));
#ifdef OHCI_DEBUG
#ifdef USB_DEBUG
if (ohcidebug > 5)
ohci_dumpregs(sc);
#endif
@ -1001,7 +1001,7 @@ ohci_power(int why, void *v)
u_int32_t ctl;
int s;
#ifdef OHCI_DEBUG
#ifdef USB_DEBUG
DPRINTF(("ohci_power: sc=%p, why=%d\n", sc, why));
ohci_dumpregs(sc);
#endif
@ -1056,7 +1056,7 @@ ohci_power(int why, void *v)
}
#endif
#ifdef OHCI_DEBUG
#ifdef USB_DEBUG
void
ohci_dumpregs(ohci_softc_t *sc)
{
@ -1245,7 +1245,7 @@ ohci_rhsc_enable(void *v_sc)
ohci_rhsc_able(sc, 1);
}
#ifdef OHCI_DEBUG
#ifdef USB_DEBUG
char *ohci_cc_strs[] = {
"NO_ERROR",
"CRC",
@ -1325,7 +1325,7 @@ ohci_softintr(void *v)
DPRINTFN(10,("ohci_softintr: sdone=%p sidone=%p\n", sdone, sidone));
#ifdef OHCI_DEBUG
#ifdef USB_DEBUG
if (ohcidebug > 10) {
DPRINTF(("ohci_process_done: TD done:\n"));
ohci_dump_tds(sdone);
@ -1412,7 +1412,7 @@ ohci_softintr(void *v)
}
}
#ifdef OHCI_DEBUG
#ifdef USB_DEBUG
if (ohcidebug > 10) {
DPRINTF(("ohci_softintr: ITD done:\n"));
ohci_dump_itds(sidone);
@ -1599,7 +1599,7 @@ ohci_waitintr(ohci_softc_t *sc, usbd_xfer_handle xfer)
break;
intrs = OREAD4(sc, OHCI_INTERRUPT_STATUS) & sc->sc_eintrs;
DPRINTFN(15,("ohci_waitintr: 0x%04x\n", intrs));
#ifdef OHCI_DEBUG
#ifdef USB_DEBUG
if (ohcidebug > 15)
ohci_dumpregs(sc);
#endif
@ -1621,7 +1621,7 @@ void
ohci_poll(struct usbd_bus *bus)
{
ohci_softc_t *sc = (ohci_softc_t *)bus;
#ifdef OHCI_DEBUG
#ifdef USB_DEBUG
static int last;
int new;
new = OREAD4(sc, OHCI_INTERRUPT_STATUS);
@ -1734,7 +1734,7 @@ ohci_device_request(usbd_xfer_handle xfer)
stat->len = 0;
stat->xfer = xfer;
#ifdef OHCI_DEBUG
#ifdef USB_DEBUG
if (ohcidebug > 5) {
DPRINTF(("ohci_device_request:\n"));
ohci_dump_ed(sed);
@ -1753,7 +1753,7 @@ ohci_device_request(usbd_xfer_handle xfer)
}
splx(s);
#ifdef OHCI_DEBUG
#ifdef USB_DEBUG
if (ohcidebug > 20) {
delay(10000);
DPRINTF(("ohci_device_request: status=%x\n",
@ -1938,7 +1938,7 @@ ohci_timeout_task(void *addr)
splx(s);
}
#ifdef OHCI_DEBUG
#ifdef USB_DEBUG
void
ohci_dump_tds(ohci_soft_td_t *std)
{
@ -2160,7 +2160,7 @@ ohci_close_pipe(usbd_pipe_handle pipe, ohci_soft_ed_t *head)
#ifdef USB_DEBUG
usbd_dump_pipe(&opipe->pipe);
#endif
#ifdef OHCI_DEBUG
#ifdef USB_DEBUG
ohci_dump_ed(sed);
if (std)
ohci_dump_td(std);
@ -2248,7 +2248,7 @@ ohci_abort_xfer(usbd_xfer_handle xfer, usbd_status status)
return;
}
#endif
#ifdef OHCI_DEBUG
#ifdef USB_DEBUG
if (ohcidebug > 1) {
DPRINTF(("ohci_abort_xfer: sed=\n"));
ohci_dump_ed(sed);
@ -2903,7 +2903,7 @@ ohci_device_bulk_start(usbd_xfer_handle xfer)
(int)le32toh(data->td.td_cbp),
(int)le32toh(data->td.td_be)));
#ifdef OHCI_DEBUG
#ifdef USB_DEBUG
if (ohcidebug > 5) {
ohci_dump_ed(sed);
ohci_dump_tds(data);
@ -3022,7 +3022,7 @@ ohci_device_intr_start(usbd_xfer_handle xfer)
data->flags = OHCI_CALL_DONE | OHCI_ADD_LEN;
xfer->hcpriv = data;
#ifdef OHCI_DEBUG
#ifdef USB_DEBUG
if (ohcidebug > 5) {
DPRINTF(("ohci_device_intr_transfer:\n"));
ohci_dump_ed(sed);
@ -3294,7 +3294,7 @@ ohci_device_isoc_enter(usbd_xfer_handle xfer)
xfer->status = USBD_IN_PROGRESS;
#ifdef OHCI_DEBUG
#ifdef USB_DEBUG
if (ohcidebug > 5) {
DPRINTF(("ohci_device_isoc_enter: frame=%d\n",
le32toh(sc->sc_hcca->hcca_frame_number)));
@ -3308,7 +3308,7 @@ ohci_device_isoc_enter(usbd_xfer_handle xfer)
sed->ed.ed_tailp = htole32(nsitd->physaddr);
splx(s);
#ifdef OHCI_DEBUG
#ifdef USB_DEBUG
if (ohcidebug > 5) {
delay(150000);
DPRINTF(("ohci_device_isoc_enter: after frame=%d\n",

View File

@ -100,8 +100,8 @@
#include <dev/usb/ucomvar.h>
#ifdef UCOM_DEBUG
static int ucomdebug = 1;
#ifdef USB_DEBUG
static int ucomdebug = 0;
SYSCTL_INT(_debug_usb, OID_AUTO, ucom, CTLFLAG_RW,
&ucomdebug, 0, "ucom debug level");
#define DPRINTF(x) do { \

View File

@ -181,9 +181,3 @@ extern devclass_t ucom_devclass;
int ucom_attach(struct ucom_softc *);
int ucom_detach(struct ucom_softc *);
void ucom_status_change(struct ucom_softc *);
#if 0
#define UCOM_DEBUG 1
#define UPLCOM_DEBUG 1
#define UVSCOM_DEBUG 1
#endif

View File

@ -104,10 +104,10 @@
#include <dev/usb/udbp.h>
#include <netgraph/netgraph.h>
#ifdef UDBP_DEBUG
#ifdef USB_DEBUG
#define DPRINTF(x) if (udbpdebug) logprintf x
#define DPRINTFN(n,x) if (udbpdebug>(n)) logprintf x
int udbpdebug = 9;
int udbpdebug = 0;
SYSCTL_INT(_debug_usb, OID_AUTO, udbp, CTLFLAG_RW,
&udbpdebug, 0, "udbp debug level");
#else

View File

@ -64,10 +64,10 @@
#include <dev/usb/usbdevs.h>
#include <dev/usb/dsbr100io.h>
#ifdef UFM_DEBUG
#ifdef USB_DEBUG
#define DPRINTF(x) if (ufmdebug) logprintf x
#define DPRINTFN(n,x) if (ufmdebug>(n)) logprintf x
int ufmdebug = 100;
int ufmdebug = 0;
SYSCTL_INT(_debug_usb, OID_AUTO, ufm, CTLFLAG_RW,
&ufmdebug, 0, "ufm debug level");
#else

View File

@ -69,7 +69,7 @@
#include <dev/usb/usbdi.h>
#include <dev/usb/usbdi_util.h>
#ifdef UGEN_DEBUG
#ifdef USB_DEBUG
#define DPRINTF(x) if (ugendebug) logprintf x
#define DPRINTFN(n,x) if (ugendebug>(n)) logprintf x
int ugendebug = 0;
@ -1130,7 +1130,7 @@ ugen_do_ioctl(struct ugen_softc *sc, int endpt, u_long cmd,
return (EINVAL);
switch (cmd) {
#ifdef UGEN_DEBUG
#ifdef USB_DEBUG
case USB_SETDEBUG:
ugendebug = *(int *)addr;
break;

View File

@ -97,7 +97,7 @@ struct cfdriver uhci_cd = {
};
#endif
#ifdef UHCI_DEBUG
#ifdef USB_DEBUG
uhci_softc_t *thesc;
#define DPRINTF(x) if (uhcidebug) printf x
#define DPRINTFN(n,x) if (uhcidebug>(n)) printf x
@ -265,7 +265,7 @@ Static void uhci_noop(usbd_pipe_handle pipe);
Static __inline__ uhci_soft_qh_t *uhci_find_prev_qh(uhci_soft_qh_t *,
uhci_soft_qh_t *);
#ifdef UHCI_DEBUG
#ifdef USB_DEBUG
Static void uhci_dump_all(uhci_softc_t *);
Static void uhci_dumpregs(uhci_softc_t *);
Static void uhci_dump_qhs(uhci_soft_qh_t *);
@ -372,7 +372,7 @@ uhci_find_prev_qh(uhci_soft_qh_t *pqh, uhci_soft_qh_t *sqh)
DPRINTFN(15,("uhci_find_prev_qh: pqh=%p sqh=%p\n", pqh, sqh));
for (; pqh->hlink != sqh; pqh = pqh->hlink) {
#if defined(DIAGNOSTIC) || defined(UHCI_DEBUG)
#if defined(DIAGNOSTIC) || defined(USB_DEBUG)
if (le32toh(pqh->qh.qh_hlink) & UHCI_PTR_T) {
printf("uhci_find_prev_qh: QH not found\n");
return (NULL);
@ -400,7 +400,7 @@ uhci_init(uhci_softc_t *sc)
DPRINTFN(1,("uhci_init: start\n"));
#ifdef UHCI_DEBUG
#ifdef USB_DEBUG
thesc = sc;
if (uhcidebug > 2)
@ -676,7 +676,7 @@ uhci_power(int why, void *v)
sc, why, sc->sc_suspend, cmd));
if (why != PWR_RESUME) {
#ifdef UHCI_DEBUG
#ifdef USB_DEBUG
if (uhcidebug > 2)
uhci_dumpregs(sc);
#endif
@ -723,7 +723,7 @@ uhci_power(int why, void *v)
if (sc->sc_intr_xfer != NULL)
usb_callout(sc->sc_poll_handle, sc->sc_ival,
uhci_poll_hub, sc->sc_intr_xfer);
#ifdef UHCI_DEBUG
#ifdef USB_DEBUG
if (uhcidebug > 2)
uhci_dumpregs(sc);
#endif
@ -731,7 +731,7 @@ uhci_power(int why, void *v)
splx(s);
}
#ifdef UHCI_DEBUG
#ifdef USB_DEBUG
Static void
uhci_dumpregs(uhci_softc_t *sc)
{
@ -974,7 +974,7 @@ uhci_root_ctrl_done(usbd_xfer_handle xfer)
*/
void
uhci_add_loop(uhci_softc_t *sc) {
#ifdef UHCI_DEBUG
#ifdef USB_DEBUG
if (uhcinoloop)
return;
#endif
@ -988,7 +988,7 @@ uhci_add_loop(uhci_softc_t *sc) {
void
uhci_rem_loop(uhci_softc_t *sc) {
#ifdef UHCI_DEBUG
#ifdef USB_DEBUG
if (uhcinoloop)
return;
#endif
@ -1174,7 +1174,7 @@ uhci_intr1(uhci_softc_t *sc)
return(0);
}
#ifdef UHCI_DEBUG
#ifdef USB_DEBUG
if (uhcidebug > 15) {
DPRINTF(("%s: uhci_intr1\n", USBDEVNAME(sc->sc_bus.bdev)));
uhci_dumpregs(sc);
@ -1203,7 +1203,7 @@ uhci_intr1(uhci_softc_t *sc)
ack |= UHCI_STS_USBEI;
if (status & UHCI_STS_RD) {
ack |= UHCI_STS_RD;
#ifdef UHCI_DEBUG
#ifdef USB_DEBUG
printf("%s: resume detect\n", USBDEVNAME(sc->sc_bus.bdev));
#endif
}
@ -1221,7 +1221,7 @@ uhci_intr1(uhci_softc_t *sc)
if (!sc->sc_dying) {
printf("%s: host controller halted\n",
USBDEVNAME(sc->sc_bus.bdev));
#ifdef UHCI_DEBUG
#ifdef USB_DEBUG
uhci_dump_all(sc);
#endif
}
@ -1349,7 +1349,7 @@ uhci_idone(uhci_intr_info_t *ii)
int s = splhigh();
if (ii->isdone) {
splx(s);
#ifdef UHCI_DEBUG
#ifdef USB_DEBUG
printf("uhci_idone: ii is done!\n ");
uhci_dump_ii(ii);
#else
@ -1374,7 +1374,7 @@ uhci_idone(uhci_intr_info_t *ii)
n = UXFER(xfer)->curframe;
for (i = 0; i < nframes; i++) {
std = stds[n];
#ifdef UHCI_DEBUG
#ifdef USB_DEBUG
if (uhcidebug > 5) {
DPRINTFN(-1,("uhci_idone: isoc TD %d\n", i));
uhci_dump_td(std);
@ -1393,7 +1393,7 @@ uhci_idone(uhci_intr_info_t *ii)
goto end;
}
#ifdef UHCI_DEBUG
#ifdef USB_DEBUG
DPRINTFN(10, ("uhci_idone: ii=%p, xfer=%p, pipe=%p ready\n",
ii, xfer, upipe));
if (uhcidebug > 10)
@ -1421,7 +1421,7 @@ uhci_idone(uhci_intr_info_t *ii)
actlen, status));
xfer->actlen = actlen;
if (status != 0) {
#ifdef UHCI_DEBUG
#ifdef USB_DEBUG
char sbuf[128];
bitmask_snprintf((u_int32_t)status,
@ -1819,7 +1819,7 @@ uhci_device_bulk_start(usbd_xfer_handle xfer)
return (err);
dataend->td.td_status |= htole32(UHCI_TD_IOC);
#ifdef UHCI_DEBUG
#ifdef USB_DEBUG
if (uhcidebug > 8) {
DPRINTF(("uhci_device_bulk_transfer: data(1)\n"));
uhci_dump_tds(data);
@ -1851,7 +1851,7 @@ uhci_device_bulk_start(usbd_xfer_handle xfer)
xfer->status = USBD_IN_PROGRESS;
splx(s);
#ifdef UHCI_DEBUG
#ifdef USB_DEBUG
if (uhcidebug > 10) {
DPRINTF(("uhci_device_bulk_transfer: data(2)\n"));
uhci_dump_tds(data);
@ -2041,7 +2041,7 @@ uhci_device_intr_start(usbd_xfer_handle xfer)
return (err);
dataend->td.td_status |= htole32(UHCI_TD_IOC);
#ifdef UHCI_DEBUG
#ifdef USB_DEBUG
if (uhcidebug > 10) {
DPRINTF(("uhci_device_intr_transfer: data(1)\n"));
uhci_dump_tds(data);
@ -2072,7 +2072,7 @@ uhci_device_intr_start(usbd_xfer_handle xfer)
xfer->status = USBD_IN_PROGRESS;
splx(s);
#ifdef UHCI_DEBUG
#ifdef USB_DEBUG
if (uhcidebug > 10) {
DPRINTF(("uhci_device_intr_transfer: data(2)\n"));
uhci_dump_tds(data);
@ -2203,7 +2203,7 @@ uhci_device_request(usbd_xfer_handle xfer)
UHCI_TD_IN (0, endpt, addr, 1));
stat->td.td_buffer = htole32(0);
#ifdef UHCI_DEBUG
#ifdef USB_DEBUG
if (uhcidebug > 10) {
DPRINTF(("uhci_device_request: before transfer\n"));
uhci_dump_tds(setup);
@ -2230,7 +2230,7 @@ uhci_device_request(usbd_xfer_handle xfer)
else
uhci_add_hs_ctrl(sc, sqh);
uhci_add_intr_info(sc, ii);
#ifdef UHCI_DEBUG
#ifdef USB_DEBUG
if (uhcidebug > 12) {
uhci_soft_td_t *std;
uhci_soft_qh_t *xqh;
@ -2349,7 +2349,7 @@ uhci_device_isoc_enter(usbd_xfer_handle xfer)
std->td.td_status = htole32(status);
std->td.td_token &= htole32(~UHCI_TD_MAXLEN_MASK);
std->td.td_token |= htole32(UHCI_TD_SET_MAXLEN(len));
#ifdef UHCI_DEBUG
#ifdef USB_DEBUG
if (uhcidebug > 5) {
DPRINTFN(5,("uhci_device_isoc_enter: TD %d\n", i));
uhci_dump_td(std);
@ -2578,7 +2578,7 @@ uhci_device_isoc_done(usbd_xfer_handle xfer)
if (ii->stdend == NULL) {
printf("uhci_device_isoc_done: xfer=%p stdend==NULL\n", xfer);
#ifdef UHCI_DEBUG
#ifdef USB_DEBUG
uhci_dump_ii(ii);
#endif
return;
@ -2593,7 +2593,7 @@ uhci_device_isoc_done(usbd_xfer_handle xfer)
#ifdef DIAGNOSTIC
if (ii->stdend == NULL) {
printf("uhci_device_isoc_done: xfer=%p stdend==NULL\n", xfer);
#ifdef UHCI_DEBUG
#ifdef USB_DEBUG
uhci_dump_ii(ii);
#endif
return;
@ -2631,7 +2631,7 @@ uhci_device_intr_done(usbd_xfer_handle xfer)
&xfer->dmabuf, &data, &dataend);
dataend->td.td_status |= htole32(UHCI_TD_IOC);
#ifdef UHCI_DEBUG
#ifdef USB_DEBUG
if (uhcidebug > 10) {
DPRINTF(("uhci_device_intr_done: data(1)\n"));
uhci_dump_tds(data);

View File

@ -83,7 +83,7 @@
/* Report descriptor for broken Wacom Graphire */
#include <dev/usb/ugraphire_rdesc.h>
#ifdef UHID_DEBUG
#ifdef USB_DEBUG
#define DPRINTF(x) if (uhiddebug) logprintf x
#define DPRINTFN(n,x) if (uhiddebug>(n)) logprintf x
int uhiddebug = 0;
@ -356,7 +356,7 @@ uhid_intr(usbd_xfer_handle xfer, usbd_private_handle addr, usbd_status status)
{
struct uhid_softc *sc = addr;
#ifdef UHID_DEBUG
#ifdef USB_DEBUG
if (uhiddebug > 5) {
u_int32_t cc, i;

View File

@ -65,7 +65,7 @@
#define UHUB_INTR_INTERVAL 255 /* ms */
#ifdef UHUB_DEBUG
#ifdef USB_DEBUG
#define DPRINTF(x) if (uhubdebug) logprintf x
#define DPRINTFN(n,x) if (uhubdebug>(n)) logprintf x
int uhubdebug = 0;

View File

@ -76,10 +76,10 @@
#define delay(d) DELAY(d)
#ifdef UKBD_DEBUG
#ifdef USB_DEBUG
#define DPRINTF(x) if (ukbddebug) logprintf x
#define DPRINTFN(n,x) if (ukbddebug>(n)) logprintf x
int ukbddebug = 1;
int ukbddebug = 0;
SYSCTL_INT(_debug_usb, OID_AUTO, ukbd, CTLFLAG_RW,
&ukbddebug, 0, "ukbd debug level");
#else
@ -775,7 +775,7 @@ ukbd_interrupt(keyboard_t *kbd, void *arg)
if (state->ks_inputs <= 0)
return 0;
#ifdef UKBD_DEBUG
#ifdef USB_DEBUG
for (i = state->ks_inputhead, j = 0; j < state->ks_inputs; ++j,
i = (i + 1)%INPUTBUFSIZE) {
c = state->ks_input[i];
@ -789,7 +789,7 @@ ukbd_interrupt(keyboard_t *kbd, void *arg)
DPRINTF(("%d ", ud->keycode[i]));
}
DPRINTF(("\n"));
#endif /* UKBD_DEBUG */
#endif /* USB_DEBUG */
if (state->ks_polling)
return 0;
@ -1250,7 +1250,7 @@ ukbd_ioctl(keyboard_t *kbd, u_long cmd, caddr_t arg)
splx(s);
return genkbd_commonioctl(kbd, cmd, arg);
#ifdef UKBD_DEBUG
#ifdef USB_DEBUG
case USB_SETDEBUG:
ukbddebug = *(int *)arg;
break;

View File

@ -72,7 +72,7 @@
#define LPTPRI (PZERO+8)
#define ULPT_BSIZE 16384
#ifdef ULPT_DEBUG
#ifdef USB_DEBUG
#define DPRINTF(x) if (ulptdebug) logprintf x
#define DPRINTFN(n,x) if (ulptdebug>(n)) logprintf x
int ulptdebug = 0;
@ -503,7 +503,7 @@ ulptopen(dev_t dev, int flag, int mode, usb_proc_ptr p)
sc->sc_flags = flags;
DPRINTF(("ulptopen: flags=0x%x\n", (unsigned)flags));
#if defined(ULPT_DEBUG) && defined(__FreeBSD__)
#if defined(USB_DEBUG) && defined(__FreeBSD__)
/* Ignoring these flags might not be a good idea */
if ((flags & ~ULPT_NOPRIME) != 0)
printf("ulptopen: flags ignored: %b\n", flags,

View File

@ -121,7 +121,7 @@
#include <sys/devicestat.h>
#include <cam/cam_periph.h>
#ifdef UMASS_DEBUG
#ifdef USB_DEBUG
#define DIF(m, x) if (umassdebug & (m)) do { x ; } while (0)
#define DPRINTF(m, x) if (umassdebug & (m)) logprintf x
#define UDMASS_GEN 0x00010000 /* general */
@ -134,7 +134,7 @@
#define UDMASS_CBI 0x00400000 /* CBI transfers */
#define UDMASS_WIRE (UDMASS_BBB|UDMASS_CBI)
#define UDMASS_ALL 0xffff0000 /* all of the above */
int umassdebug = UDMASS_ALL;
int umassdebug = 0;
SYSCTL_INT(_debug_usb, OID_AUTO, umass, CTLFLAG_RW,
&umassdebug, 0, "umass debug level");
#else
@ -171,7 +171,7 @@ SYSCTL_INT(_debug_usb, OID_AUTO, umass, CTLFLAG_RW,
*
* The SIM is the highest target number, so umass0 corresponds to SCSI target 0.
*/
#ifndef UMASS_DEBUG
#ifndef USB_DEBUG
#define UMASS_SCSIID_MAX 32 /* maximum number of drives expected */
#else
/* while debugging avoid unnecessary clutter in the output at umass_cam_rescan
@ -491,7 +491,7 @@ struct umass_softc {
int maxlun; /* maximum LUN number */
};
#ifdef UMASS_DEBUG
#ifdef USB_DEBUG
char *states[TSTATE_STATES+1] = {
/* should be kept in sync with the list at transfer_state */
"Attach",
@ -616,7 +616,7 @@ Static int umass_rbc_transform (struct umass_softc *sc,
unsigned char *cmd, int cmdlen,
unsigned char **rcmd, int *rcmdlen);
#ifdef UMASS_DEBUG
#ifdef USB_DEBUG
/* General debugging functions */
Static void umass_bbb_dump_cbw (struct umass_softc *sc, umass_bbb_cbw_t *cbw);
Static void umass_bbb_dump_csw (struct umass_softc *sc, umass_bbb_csw_t *csw);
@ -781,7 +781,7 @@ USB_ATTACH(umass)
id = usbd_get_interface_descriptor(sc->iface);
printf("%s: %s\n", USBDEVNAME(sc->sc_dev), devinfo);
#ifdef UMASS_DEBUG
#ifdef USB_DEBUG
printf("%s: ", USBDEVNAME(sc->sc_dev));
switch (sc->proto&UMASS_PROTO_COMMAND) {
case UMASS_PROTO_SCSI:
@ -866,7 +866,7 @@ USB_ATTACH(umass)
&& UE_GET_DIR(ed->bEndpointAddress) == UE_DIR_IN
&& (ed->bmAttributes & UE_XFERTYPE) == UE_INTERRUPT) {
sc->intrin = ed->bEndpointAddress;
#ifdef UMASS_DEBUG
#ifdef USB_DEBUG
if (UGETW(ed->wMaxPacketSize) > 2) {
DPRINTF(UDMASS_CBI, ("%s: intr size is %d\n",
USBDEVNAME(sc->sc_dev),
@ -948,7 +948,7 @@ USB_ATTACH(umass)
sc->reset = umass_cbi_reset;
sc->transfer = umass_cbi_transfer;
sc->state = umass_cbi_state;
#ifdef UMASS_DEBUG
#ifdef USB_DEBUG
} else {
panic("%s:%d: Unknown proto 0x%02x\n",
__FILE__, __LINE__, sc->proto);
@ -963,7 +963,7 @@ USB_ATTACH(umass)
sc->transform = umass_atapi_transform;
else if (sc->proto & UMASS_PROTO_RBC)
sc->transform = umass_rbc_transform;
#ifdef UMASS_DEBUG
#ifdef USB_DEBUG
else
panic("No transformation defined for command proto 0x%02x\n",
sc->proto & UMASS_PROTO_COMMAND);
@ -2082,7 +2082,7 @@ umass_cam_attach_sim()
Static void
umass_cam_rescan_callback(struct cam_periph *periph, union ccb *ccb)
{
#ifdef UMASS_DEBUG
#ifdef USB_DEBUG
if (ccb->ccb_h.status != CAM_REQ_CMP) {
DPRINTF(UDMASS_SCSI, ("scbus%d: Rescan failed, 0x%04x\n",
cam_sim_path(umass_sim),
@ -2104,7 +2104,7 @@ umass_cam_rescan(void *addr)
* is disconnected before umass_cam_rescan has been able to run the
* driver might bomb.
*/
#ifdef UMASS_DEBUG
#ifdef USB_DEBUG
struct umass_softc *sc = (struct umass_softc *) addr;
#endif
struct cam_path *path;
@ -2148,7 +2148,7 @@ umass_cam_attach(struct umass_softc *sc)
return(1);
}
#ifndef UMASS_DEBUG
#ifndef USB_DEBUG
if (bootverbose)
#endif
printf("%s:%d:%d:%d: Attached to scbus%d as device %d\n",
@ -2449,7 +2449,7 @@ umass_cam_action(struct cam_sim *sim, union ccb *ccb)
}
case XPT_CALC_GEOMETRY:
{
#ifdef UMASS_DEBUG
#ifdef USB_DEBUG
struct ccb_calc_geometry *ccg = &ccb->ccg;
#endif
DPRINTF(UDMASS_SCSI, ("%s:%d:%d:%d:XPT_CALC_GEOMETRY: "
@ -2495,7 +2495,7 @@ umass_cam_action(struct cam_sim *sim, union ccb *ccb)
Static void
umass_cam_poll(struct cam_sim *sim)
{
#ifdef UMASS_DEBUG
#ifdef USB_DEBUG
struct umass_softc *sc = (struct umass_softc *) sim->softc;
DPRINTF(UDMASS_SCSI, ("%s: CAM poll\n",
@ -2981,7 +2981,7 @@ DRIVER_MODULE(umass, uhub, umass_driver, umass_devclass, umass_driver_load, 0);
#ifdef UMASS_DEBUG
#ifdef USB_DEBUG
Static void
umass_bbb_dump_cbw(struct umass_softc *sc, umass_bbb_cbw_t *cbw)
{

View File

@ -87,10 +87,10 @@
#include <dev/usb/usbdevs.h>
#ifdef UMODEM_DEBUG
#ifdef USB_DEBUG
#define DPRINTF(x) if(umodemdebug) logprintf x
#define DPRINTFN(n, x) if(umodemdebug > (n)) logprintf x
int umodemdebug = 1;
int umodemdebug = 0;
SYSCTL_INT(_debug_usb, OID_AUTO, umodem, CTLFLAG_RW,
&umodemdebug, 0, "umodem debug level");
#else

View File

@ -71,10 +71,10 @@
#include <sys/mouse.h>
#ifdef UMS_DEBUG
#ifdef USB_DEBUG
#define DPRINTF(x) if (umsdebug) logprintf x
#define DPRINTFN(n,x) if (umsdebug>(n)) logprintf x
int umsdebug = 1;
int umsdebug = 0;
SYSCTL_INT(_debug_usb, OID_AUTO, ums, CTLFLAG_RW,
&umsdebug, 0, "ums debug level");
#else
@ -310,7 +310,7 @@ USB_ATTACH(ums)
sc->sc_disconnected = 0;
free(desc, M_TEMP);
#ifdef UMS_DEBUG
#ifdef USB_DEBUG
DPRINTF(("ums_attach: sc=%p\n", sc));
DPRINTF(("ums_attach: X\t%d/%d\n",
sc->sc_loc_x.pos, sc->sc_loc_x.size));

View File

@ -101,8 +101,8 @@
#include <dev/usb/ucomvar.h>
#ifdef UPLCOM_DEBUG
static int uplcomdebug = 1;
#ifdef USB_DEBUG
static int uplcomdebug = 0;
SYSCTL_INT(_debug_usb, OID_AUTO, uplcom, CTLFLAG_RW,
&uplcomdebug, 0, "uplcom debug level");

View File

@ -76,10 +76,10 @@
#include <dev/usb/usbdevs.h>
#include <dev/usb/rio500_usb.h>
#ifdef URIO_DEBUG
#ifdef USB_DEBUG
#define DPRINTF(x) if (uriodebug) logprintf x
#define DPRINTFN(n,x) if (uriodebug>(n)) logprintf x
int uriodebug = 100;
int uriodebug = 0;
SYSCTL_INT(_debug_usb, OID_AUTO, urio, CTLFLAG_RW,
&uriodebug, 0, "urio debug level");
#else

View File

@ -103,10 +103,10 @@ SYSCTL_NODE(_debug, OID_AUTO, usb, CTLFLAG_RW, 0, "USB debugging");
int usbdebug = 0;
SYSCTL_INT(_debug_usb, OID_AUTO, usb, CTLFLAG_RW,
&usbdebug, 0, "usb debug level");
#ifdef UHCI_DEBUG
#ifdef USB_DEBUG
extern int uhcidebug;
#endif
#ifdef OHCI_DEBUG
#ifdef USB_DEBUG
extern int ohcidebug;
#endif
/*
@ -576,12 +576,8 @@ usbioctl(dev_t devt, u_long cmd, caddr_t data, int flag, usb_proc_ptr p)
#ifdef USB_DEBUG
case USB_SETDEBUG:
usbdebug = ((*(int *)data) & 0x000000ff);
#ifdef UHCI_DEBUG
uhcidebug = ((*(int *)data) & 0x0000ff00) >> 8;
#endif
#ifdef OHCI_DEBUG
ohcidebug = ((*(int *)data) & 0x00ff0000) >> 16;
#endif
break;
#endif /* USB_DEBUG */
case USB_REQUEST:

View File

@ -56,36 +56,6 @@
#define USB_USE_SOFTINTR
#ifdef USB_DEBUG
#define UKBD_DEBUG 1
#define UHIDEV_DEBUG 1
#define UHID_DEBUG 1
#define OHCI_DEBUG 1
#define UGEN_DEBUG 1
#define UHCI_DEBUG 1
#define UHUB_DEBUG 1
#define ULPT_DEBUG 1
#define UCOM_DEBUG 1
#define UPLCOM_DEBUG 1
#define UMCT_DEBUG 1
#define UMODEM_DEBUG 1
#define UAUDIO_DEBUG 1
#define AUE_DEBUG 1
#define CUE_DEBUG 1
#define KUE_DEBUG 1
#define URL_DEBUG 1
#define UMASS_DEBUG 1
#define UVISOR_DEBUG 1
#define UPL_DEBUG 1
#define UZCOM_DEBUG 1
#define URIO_DEBUG 1
#define UFTDI_DEBUG 1
#define USCANNER_DEBUG 1
#define USSCANNER_DEBUG 1
#define EHCI_DEBUG 1
#define UIRDA_DEBUG 1
#define USTIR_DEBUG 1
#define UISDATA_DEBUG 1
#define UDSBR_DEBUG 1
#define Static
#else
#define Static static
@ -185,30 +155,6 @@ int __CONCAT(dname,_detach)(struct device *self, int flags)
/*
* OpenBSD
*/
#ifdef USB_DEBUG
#define UKBD_DEBUG 1
#define UHID_DEBUG 1
#define OHCI_DEBUG 1
#define UGEN_DEBUG 1
#define UHCI_DEBUG 1
#define UHUB_DEBUG 1
#define ULPT_DEBUG 1
#define UCOM_DEBUG 1
#define UMODEM_DEBUG 1
#define UAUDIO_DEBUG 1
#define AUE_DEBUG 1
#define CUE_DEBUG 1
#define KUE_DEBUG 1
#define UMASS_DEBUG 1
#define UVISOR_DEBUG 1
#define UPL_DEBUG 1
#define UZCOM_DEBUG 1
#define URIO_DEBUG 1
#define UFTDI_DEBUG 1
#define USCANNER_DEBUG 1
#define USSCANNER_DEBUG 1
#endif
#define Static
typedef struct proc *usb_proc_ptr;

View File

@ -72,7 +72,7 @@
#include <dev/usb/usbdevs.h>
#ifdef USCANNER_DEBUG
#ifdef USB_DEBUG
#define DPRINTF(x) if (uscannerdebug) logprintf x
#define DPRINTFN(n,x) if (uscannerdebug>(n)) logprintf x
int uscannerdebug = 0;

View File

@ -75,7 +75,7 @@
#include <dev/usb/ucomvar.h>
#ifdef UVISOR_DEBUG
#ifdef USB_DEBUG
#define DPRINTF(x) if (uvisordebug) printf x
#define DPRINTFN(n,x) if (uvisordebug>(n)) printf x
int uvisordebug = 0;
@ -396,7 +396,7 @@ uvisor_init(struct uvisor_softc *sc)
if (err)
return (err);
#ifdef UVISOR_DEBUG
#ifdef USB_DEBUG
{
int i, np;
char *string;

View File

@ -69,8 +69,8 @@
#include <dev/usb/ucomvar.h>
#ifdef UVSCOM_DEBUG
static int uvscomdebug = 1;
#ifdef USB_DEBUG
static int uvscomdebug = 0;
SYSCTL_INT(_debug_usb, OID_AUTO, uvscom, CTLFLAG_RW,
&uvscomdebug, 0, "uvscom debug level");