Change USB_DEBUG to #ifdef and allow it to be turned off. Previously this had

the illusion of a tunable setting but was always turned on regardless.

MFC after:	1 week
This commit is contained in:
Andrew Thompson 2010-04-22 21:31:34 +00:00
parent 139e9ad4d6
commit b850ecc180
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=207077
58 changed files with 121 additions and 106 deletions

View file

@ -281,6 +281,7 @@ device firmware # firmware assist module
device bpf # Berkeley packet filter device bpf # Berkeley packet filter
# USB support # USB support
#options USB_DEBUG # enable debug msgs
device uhci # UHCI PCI->USB interface device uhci # UHCI PCI->USB interface
device ohci # OHCI PCI->USB interface device ohci # OHCI PCI->USB interface
device ehci # EHCI PCI->USB interface (USB 2.0) device ehci # EHCI PCI->USB interface (USB 2.0)

View file

@ -67,6 +67,7 @@ device e1000phy
device bpf device bpf
# USB # USB
options USB_DEBUG # enable debug msgs
device usb device usb
device ehci device ehci
device umass device umass

View file

@ -74,6 +74,7 @@ device iicbus
device ds133x device ds133x
# USB # USB
options USB_DEBUG # enable debug msgs
device usb device usb
device ehci device ehci
device umass device umass

View file

@ -67,6 +67,7 @@ device e1000phy
device bpf device bpf
# USB # USB
options USB_DEBUG # enable debug msgs
device usb device usb
device ehci device ehci
device umass device umass

View file

@ -95,6 +95,7 @@ device icee
device bpf device bpf
# USB support # USB support
options USB_DEBUG # enable debug msgs
device ohci # OHCI localbus->USB interface device ohci # OHCI localbus->USB interface
device usb # USB Bus (required) device usb # USB Bus (required)
#device udbp # USB Double Bulk Pipe devices #device udbp # USB Double Bulk Pipe devices

View file

@ -96,6 +96,7 @@ device icee
device bpf device bpf
# USB support # USB support
options USB_DEBUG # enable debug msgs
device ohci # OHCI localbus->USB interface device ohci # OHCI localbus->USB interface
device usb # USB Bus (required) device usb # USB Bus (required)
#device udbp # USB Double Bulk Pipe devices #device udbp # USB Double Bulk Pipe devices

View file

@ -79,6 +79,7 @@ options WITNESS_SKIPSPIN #Don't run witness on spinlocks for speed
device md device md
options USB_DEBUG # enable debug msgs
device usb device usb
device ohci device ohci
device umass device umass

View file

@ -61,6 +61,7 @@ options DEVICE_POLLING
device vlan device vlan
# USB # USB
options USB_DEBUG # enable debug msgs
device usb device usb
device ehci device ehci
device umass device umass

View file

@ -91,7 +91,7 @@ static int uaudio_default_rate = 0; /* use rate list */
static int uaudio_default_bits = 32; static int uaudio_default_bits = 32;
static int uaudio_default_channels = 0; /* use default */ static int uaudio_default_channels = 0; /* use default */
#if USB_DEBUG #ifdef USB_DEBUG
static int uaudio_debug = 0; static int uaudio_debug = 0;
SYSCTL_NODE(_hw_usb, OID_AUTO, uaudio, CTLFLAG_RW, 0, "USB uaudio"); SYSCTL_NODE(_hw_usb, OID_AUTO, uaudio, CTLFLAG_RW, 0, "USB uaudio");
@ -321,7 +321,7 @@ static const struct uaudio_format uaudio_formats[] = {
#define UAC_RECORD 3 #define UAC_RECORD 3
#define UAC_NCLASSES 4 #define UAC_NCLASSES 4
#if USB_DEBUG #ifdef USB_DEBUG
static const char *uac_names[] = { static const char *uac_names[] = {
"outputs", "inputs", "equalization", "record" "outputs", "inputs", "equalization", "record"
}; };
@ -406,7 +406,7 @@ static void umidi_init(device_t dev);
static int32_t umidi_probe(device_t dev); static int32_t umidi_probe(device_t dev);
static int32_t umidi_detach(device_t dev); static int32_t umidi_detach(device_t dev);
#if USB_DEBUG #ifdef USB_DEBUG
static void uaudio_chan_dump_ep_desc( static void uaudio_chan_dump_ep_desc(
const usb_endpoint_descriptor_audio_t *); const usb_endpoint_descriptor_audio_t *);
static void uaudio_mixer_dump_cluster(uint8_t, static void uaudio_mixer_dump_cluster(uint8_t,
@ -780,7 +780,7 @@ uaudio_detach(device_t dev)
* AS - Audio Stream - routines * AS - Audio Stream - routines
*========================================================================*/ *========================================================================*/
#if USB_DEBUG #ifdef USB_DEBUG
static void static void
uaudio_chan_dump_ep_desc(const usb_endpoint_descriptor_audio_t *ed) uaudio_chan_dump_ep_desc(const usb_endpoint_descriptor_audio_t *ed)
{ {
@ -1019,7 +1019,7 @@ uaudio_chan_fill_info_sub(struct uaudio_softc *sc, struct usb_device *udev,
if ((chan->valid == 0) && usbd_get_iface(udev, curidx)) { if ((chan->valid == 0) && usbd_get_iface(udev, curidx)) {
chan->valid = 1; chan->valid = 1;
#if USB_DEBUG #ifdef USB_DEBUG
uaudio_chan_dump_ep_desc(ed1); uaudio_chan_dump_ep_desc(ed1);
uaudio_chan_dump_ep_desc(ed2); uaudio_chan_dump_ep_desc(ed2);
@ -1689,7 +1689,7 @@ uaudio_mixer_add_ctl(struct uaudio_softc *sc, struct uaudio_mixer_node *mc)
uaudio_mixer_add_ctl_sub(sc, mc); uaudio_mixer_add_ctl_sub(sc, mc);
#if USB_DEBUG #ifdef USB_DEBUG
if (uaudio_debug > 2) { if (uaudio_debug > 2) {
uint8_t i; uint8_t i;
@ -1708,7 +1708,7 @@ static void
uaudio_mixer_add_input(struct uaudio_softc *sc, uaudio_mixer_add_input(struct uaudio_softc *sc,
const struct uaudio_terminal_node *iot, int id) const struct uaudio_terminal_node *iot, int id)
{ {
#if USB_DEBUG #ifdef USB_DEBUG
const struct usb_audio_input_terminal *d = iot[id].u.it; const struct usb_audio_input_terminal *d = iot[id].u.it;
DPRINTFN(3, "bTerminalId=%d wTerminalType=0x%04x " DPRINTFN(3, "bTerminalId=%d wTerminalType=0x%04x "
@ -1724,7 +1724,7 @@ static void
uaudio_mixer_add_output(struct uaudio_softc *sc, uaudio_mixer_add_output(struct uaudio_softc *sc,
const struct uaudio_terminal_node *iot, int id) const struct uaudio_terminal_node *iot, int id)
{ {
#if USB_DEBUG #ifdef USB_DEBUG
const struct usb_audio_output_terminal *d = iot[id].u.ot; const struct usb_audio_output_terminal *d = iot[id].u.ot;
DPRINTFN(3, "bTerminalId=%d wTerminalType=0x%04x " DPRINTFN(3, "bTerminalId=%d wTerminalType=0x%04x "
@ -2257,7 +2257,7 @@ uaudio_mixer_verify_desc(const void *arg, uint32_t len)
return (NULL); return (NULL);
} }
#if USB_DEBUG #ifdef USB_DEBUG
static void static void
uaudio_mixer_dump_cluster(uint8_t id, const struct uaudio_terminal_node *iot) uaudio_mixer_dump_cluster(uint8_t id, const struct uaudio_terminal_node *iot)
{ {
@ -2350,7 +2350,7 @@ uaudio_mixer_get_cluster(uint8_t id, const struct uaudio_terminal_node *iot)
return (r); return (r);
} }
#if USB_DEBUG #ifdef USB_DEBUG
struct uaudio_tt_to_string { struct uaudio_tt_to_string {
uint16_t terminal_type; uint16_t terminal_type;
@ -2856,7 +2856,7 @@ uaudio_mixer_fill_info(struct uaudio_softc *sc, struct usb_device *udev,
(iot + i)->root = iot; (iot + i)->root = iot;
} while (i--); } while (i--);
#if USB_DEBUG #ifdef USB_DEBUG
i = ID_max; i = ID_max;
do { do {
uint8_t j; uint8_t j;

View file

@ -89,7 +89,7 @@ __FBSDID("$FreeBSD$");
((ehci_softc_t *)(((uint8_t *)(bus)) - \ ((ehci_softc_t *)(((uint8_t *)(bus)) - \
((uint8_t *)&(((ehci_softc_t *)0)->sc_bus)))) ((uint8_t *)&(((ehci_softc_t *)0)->sc_bus))))
#if USB_DEBUG #ifdef USB_DEBUG
static int ehcidebug = 0; static int ehcidebug = 0;
static int ehcinohighspeed = 0; static int ehcinohighspeed = 0;
static int ehciiaadbug = 0; static int ehciiaadbug = 0;
@ -258,7 +258,7 @@ ehci_init(ehci_softc_t *sc)
usb_callout_init_mtx(&sc->sc_tmo_pcd, &sc->sc_bus.bus_mtx, 0); usb_callout_init_mtx(&sc->sc_tmo_pcd, &sc->sc_bus.bus_mtx, 0);
usb_callout_init_mtx(&sc->sc_tmo_poll, &sc->sc_bus.bus_mtx, 0); usb_callout_init_mtx(&sc->sc_tmo_poll, &sc->sc_bus.bus_mtx, 0);
#if USB_DEBUG #ifdef USB_DEBUG
if (ehciiaadbug) if (ehciiaadbug)
sc->sc_flags |= EHCI_SCFLG_IAADBUG; sc->sc_flags |= EHCI_SCFLG_IAADBUG;
if (ehcilostintrbug) if (ehcilostintrbug)
@ -486,7 +486,7 @@ ehci_init(ehci_softc_t *sc)
usb_bus_mem_flush_all(&sc->sc_bus, &ehci_iterate_hw_softc); usb_bus_mem_flush_all(&sc->sc_bus, &ehci_iterate_hw_softc);
#if USB_DEBUG #ifdef USB_DEBUG
if (ehcidebug) { if (ehcidebug) {
ehci_dump_sqh(sc, sc->sc_async_p_last); ehci_dump_sqh(sc, sc->sc_async_p_last);
} }
@ -685,7 +685,7 @@ ehci_shutdown(ehci_softc_t *sc)
} }
} }
#if USB_DEBUG #ifdef USB_DEBUG
static void static void
ehci_dump_regs(ehci_softc_t *sc) ehci_dump_regs(ehci_softc_t *sc)
{ {
@ -1229,7 +1229,7 @@ ehci_non_isoc_done_sub(struct usb_xfer *xfer)
xfer->td_transfer_cache = td; xfer->td_transfer_cache = td;
#if USB_DEBUG #ifdef USB_DEBUG
if (status & EHCI_QTD_STATERRS) { if (status & EHCI_QTD_STATERRS) {
DPRINTFN(11, "error, addr=%d, endpt=0x%02x, frame=0x%02x" DPRINTFN(11, "error, addr=%d, endpt=0x%02x, frame=0x%02x"
"status=%s%s%s%s%s%s%s%s\n", "status=%s%s%s%s%s%s%s%s\n",
@ -1260,7 +1260,7 @@ ehci_non_isoc_done(struct usb_xfer *xfer)
DPRINTFN(13, "xfer=%p endpoint=%p transfer done\n", DPRINTFN(13, "xfer=%p endpoint=%p transfer done\n",
xfer, xfer->endpoint); xfer, xfer->endpoint);
#if USB_DEBUG #ifdef USB_DEBUG
if (ehcidebug > 10) { if (ehcidebug > 10) {
ehci_softc_t *sc = EHCI_BUS2SC(xfer->xroot->bus); ehci_softc_t *sc = EHCI_BUS2SC(xfer->xroot->bus);
@ -1527,7 +1527,7 @@ ehci_interrupt(ehci_softc_t *sc)
DPRINTFN(16, "real interrupt\n"); DPRINTFN(16, "real interrupt\n");
#if USB_DEBUG #ifdef USB_DEBUG
if (ehcidebug > 15) { if (ehcidebug > 15) {
ehci_dump_regs(sc); ehci_dump_regs(sc);
} }
@ -1548,7 +1548,7 @@ ehci_interrupt(ehci_softc_t *sc)
if (status & EHCI_STS_HSE) { if (status & EHCI_STS_HSE) {
printf("%s: unrecoverable error, " printf("%s: unrecoverable error, "
"controller halted\n", __FUNCTION__); "controller halted\n", __FUNCTION__);
#if USB_DEBUG #ifdef USB_DEBUG
ehci_dump_regs(sc); ehci_dump_regs(sc);
ehci_dump_isoc(sc); ehci_dump_isoc(sc);
#endif #endif
@ -1978,7 +1978,7 @@ ehci_setup_standard_chain(struct usb_xfer *xfer, ehci_qh_t **qh_last)
xfer->td_transfer_last = td; xfer->td_transfer_last = td;
#if USB_DEBUG #ifdef USB_DEBUG
if (ehcidebug > 8) { if (ehcidebug > 8) {
DPRINTF("nexttog=%d; data before transfer:\n", DPRINTF("nexttog=%d; data before transfer:\n",
xfer->endpoint->toggle_next); xfer->endpoint->toggle_next);
@ -2106,7 +2106,7 @@ ehci_isoc_fs_done(ehci_softc_t *sc, struct usb_xfer *xfer)
if (pp_last >= &sc->sc_isoc_fs_p_last[EHCI_VIRTUAL_FRAMELIST_COUNT]) { if (pp_last >= &sc->sc_isoc_fs_p_last[EHCI_VIRTUAL_FRAMELIST_COUNT]) {
pp_last = &sc->sc_isoc_fs_p_last[0]; pp_last = &sc->sc_isoc_fs_p_last[0];
} }
#if USB_DEBUG #ifdef USB_DEBUG
if (ehcidebug > 15) { if (ehcidebug > 15) {
DPRINTF("isoc FS-TD\n"); DPRINTF("isoc FS-TD\n");
ehci_dump_sitd(sc, td); ehci_dump_sitd(sc, td);
@ -2160,7 +2160,7 @@ ehci_isoc_hs_done(ehci_softc_t *sc, struct usb_xfer *xfer)
if (pp_last >= &sc->sc_isoc_hs_p_last[EHCI_VIRTUAL_FRAMELIST_COUNT]) { if (pp_last >= &sc->sc_isoc_hs_p_last[EHCI_VIRTUAL_FRAMELIST_COUNT]) {
pp_last = &sc->sc_isoc_hs_p_last[0]; pp_last = &sc->sc_isoc_hs_p_last[0];
} }
#if USB_DEBUG #ifdef USB_DEBUG
if (ehcidebug > 15) { if (ehcidebug > 15) {
DPRINTF("isoc HS-TD\n"); DPRINTF("isoc HS-TD\n");
ehci_dump_itd(sc, td); ehci_dump_itd(sc, td);
@ -2224,7 +2224,7 @@ ehci_device_done(struct usb_xfer *xfer, usb_error_t error)
if ((methods == &ehci_device_bulk_methods) || if ((methods == &ehci_device_bulk_methods) ||
(methods == &ehci_device_ctrl_methods)) { (methods == &ehci_device_ctrl_methods)) {
#if USB_DEBUG #ifdef USB_DEBUG
if (ehcidebug > 8) { if (ehcidebug > 8) {
DPRINTF("nexttog=%d; data after transfer:\n", DPRINTF("nexttog=%d; data after transfer:\n",
xfer->endpoint->toggle_next); xfer->endpoint->toggle_next);
@ -2509,7 +2509,7 @@ ehci_device_isoc_fs_enter(struct usb_xfer *xfer)
uint8_t sb; uint8_t sb;
uint8_t error; uint8_t error;
#if USB_DEBUG #ifdef USB_DEBUG
uint8_t once = 1; uint8_t once = 1;
#endif #endif
@ -2593,7 +2593,7 @@ ehci_device_isoc_fs_enter(struct usb_xfer *xfer)
/* reuse sitd_portaddr and sitd_back from last transfer */ /* reuse sitd_portaddr and sitd_back from last transfer */
if (*plen > xfer->max_frame_size) { if (*plen > xfer->max_frame_size) {
#if USB_DEBUG #ifdef USB_DEBUG
if (once) { if (once) {
once = 0; once = 0;
printf("%s: frame length(%d) exceeds %d " printf("%s: frame length(%d) exceeds %d "
@ -2683,7 +2683,7 @@ ehci_device_isoc_fs_enter(struct usb_xfer *xfer)
} }
usb_pc_cpu_flush(td->page_cache); usb_pc_cpu_flush(td->page_cache);
#if USB_DEBUG #ifdef USB_DEBUG
if (ehcidebug > 15) { if (ehcidebug > 15) {
DPRINTF("FS-TD %d\n", nframes); DPRINTF("FS-TD %d\n", nframes);
ehci_dump_sitd(sc, td); ehci_dump_sitd(sc, td);
@ -2800,7 +2800,7 @@ ehci_device_isoc_hs_enter(struct usb_xfer *xfer)
uint8_t td_no; uint8_t td_no;
uint8_t page_no; uint8_t page_no;
#if USB_DEBUG #ifdef USB_DEBUG
uint8_t once = 1; uint8_t once = 1;
#endif #endif
@ -2878,7 +2878,7 @@ ehci_device_isoc_hs_enter(struct usb_xfer *xfer)
} }
/* range check */ /* range check */
if (*plen > xfer->max_frame_size) { if (*plen > xfer->max_frame_size) {
#if USB_DEBUG #ifdef USB_DEBUG
if (once) { if (once) {
once = 0; once = 0;
printf("%s: frame length(%d) exceeds %d bytes " printf("%s: frame length(%d) exceeds %d bytes "
@ -2962,7 +2962,7 @@ ehci_device_isoc_hs_enter(struct usb_xfer *xfer)
td->itd_status[td_no - 1] |= htohc32(sc, EHCI_ITD_IOC); td->itd_status[td_no - 1] |= htohc32(sc, EHCI_ITD_IOC);
} }
usb_pc_cpu_flush(td->page_cache); usb_pc_cpu_flush(td->page_cache);
#if USB_DEBUG #ifdef USB_DEBUG
if (ehcidebug > 15) { if (ehcidebug > 15) {
DPRINTF("HS-TD %d\n", nframes); DPRINTF("HS-TD %d\n", nframes);
ehci_dump_itd(sc, td); ehci_dump_itd(sc, td);
@ -3398,7 +3398,7 @@ ehci_roothub_exec(struct usb_device *udev,
break; break;
case UHF_PORT_RESET: case UHF_PORT_RESET:
DPRINTFN(6, "reset port %d\n", index); DPRINTFN(6, "reset port %d\n", index);
#if USB_DEBUG #ifdef USB_DEBUG
if (ehcinohighspeed) { if (ehcinohighspeed) {
/* /*
* Connect USB device to companion * Connect USB device to companion

View file

@ -82,7 +82,7 @@ __FBSDID("$FreeBSD$");
((uhci_softc_t *)(((uint8_t *)(bus)) - \ ((uhci_softc_t *)(((uint8_t *)(bus)) - \
((uint8_t *)&(((uhci_softc_t *)0)->sc_bus)))) ((uint8_t *)&(((uhci_softc_t *)0)->sc_bus))))
#if USB_DEBUG #ifdef USB_DEBUG
static int uhcidebug = 0; static int uhcidebug = 0;
static int uhcinoloop = 0; static int uhcinoloop = 0;
@ -459,7 +459,7 @@ uhci_init(uhci_softc_t *sc)
usb_callout_init_mtx(&sc->sc_root_intr, &sc->sc_bus.bus_mtx, 0); usb_callout_init_mtx(&sc->sc_root_intr, &sc->sc_bus.bus_mtx, 0);
#if USB_DEBUG #ifdef USB_DEBUG
if (uhcidebug > 2) { if (uhcidebug > 2) {
uhci_dumpregs(sc); uhci_dumpregs(sc);
} }
@ -668,7 +668,7 @@ uhci_suspend(uhci_softc_t *sc)
{ {
USB_BUS_LOCK(&sc->sc_bus); USB_BUS_LOCK(&sc->sc_bus);
#if USB_DEBUG #ifdef USB_DEBUG
if (uhcidebug > 2) { if (uhcidebug > 2) {
uhci_dumpregs(sc); uhci_dumpregs(sc);
} }
@ -712,7 +712,7 @@ uhci_resume(uhci_softc_t *sc)
uhci_start(sc); uhci_start(sc);
#if USB_DEBUG #ifdef USB_DEBUG
if (uhcidebug > 2) { if (uhcidebug > 2) {
uhci_dumpregs(sc); uhci_dumpregs(sc);
} }
@ -724,7 +724,7 @@ uhci_resume(uhci_softc_t *sc)
uhci_do_poll(&sc->sc_bus); uhci_do_poll(&sc->sc_bus);
} }
#if USB_DEBUG #ifdef USB_DEBUG
static void static void
uhci_dumpregs(uhci_softc_t *sc) uhci_dumpregs(uhci_softc_t *sc)
{ {
@ -855,7 +855,7 @@ uhci_add_loop(uhci_softc_t *sc)
struct uhci_qh *qh_lst; struct uhci_qh *qh_lst;
struct uhci_qh *qh_rec; struct uhci_qh *qh_rec;
#if USB_DEBUG #ifdef USB_DEBUG
if (uhcinoloop) { if (uhcinoloop) {
return; return;
} }
@ -878,7 +878,7 @@ uhci_rem_loop(uhci_softc_t *sc)
{ {
struct uhci_qh *qh_lst; struct uhci_qh *qh_lst;
#if USB_DEBUG #ifdef USB_DEBUG
if (uhcinoloop) { if (uhcinoloop) {
return; return;
} }
@ -1046,7 +1046,7 @@ uhci_isoc_done(uhci_softc_t *sc, struct usb_xfer *xfer)
if (pp_last >= &sc->sc_isoc_p_last[UHCI_VFRAMELIST_COUNT]) { if (pp_last >= &sc->sc_isoc_p_last[UHCI_VFRAMELIST_COUNT]) {
pp_last = &sc->sc_isoc_p_last[0]; pp_last = &sc->sc_isoc_p_last[0];
} }
#if USB_DEBUG #ifdef USB_DEBUG
if (uhcidebug > 5) { if (uhcidebug > 5) {
DPRINTF("isoc TD\n"); DPRINTF("isoc TD\n");
uhci_dump_td(td); uhci_dump_td(td);
@ -1177,7 +1177,7 @@ uhci_non_isoc_done_sub(struct usb_xfer *xfer)
xfer->endpoint->toggle_next = (token & UHCI_TD_SET_DT(1)) ? 0 : 1; xfer->endpoint->toggle_next = (token & UHCI_TD_SET_DT(1)) ? 0 : 1;
#if USB_DEBUG #ifdef USB_DEBUG
if (status & UHCI_TD_ERROR) { if (status & UHCI_TD_ERROR) {
DPRINTFN(11, "error, addr=%d, endpt=0x%02x, frame=0x%02x " DPRINTFN(11, "error, addr=%d, endpt=0x%02x, frame=0x%02x "
"status=%s%s%s%s%s%s%s%s%s%s%s\n", "status=%s%s%s%s%s%s%s%s%s%s%s\n",
@ -1207,7 +1207,7 @@ uhci_non_isoc_done(struct usb_xfer *xfer)
DPRINTFN(13, "xfer=%p endpoint=%p transfer done\n", DPRINTFN(13, "xfer=%p endpoint=%p transfer done\n",
xfer, xfer->endpoint); xfer, xfer->endpoint);
#if USB_DEBUG #ifdef USB_DEBUG
if (uhcidebug > 10) { if (uhcidebug > 10) {
uhci_dump_tds(xfer->td_transfer_first); uhci_dump_tds(xfer->td_transfer_first);
} }
@ -1446,7 +1446,7 @@ uhci_interrupt(uhci_softc_t *sc)
DPRINTFN(16, "real interrupt\n"); DPRINTFN(16, "real interrupt\n");
#if USB_DEBUG #ifdef USB_DEBUG
if (uhcidebug > 15) { if (uhcidebug > 15) {
uhci_dumpregs(sc); uhci_dumpregs(sc);
} }
@ -1460,7 +1460,7 @@ uhci_interrupt(uhci_softc_t *sc)
UHCI_STS_HCPE | UHCI_STS_HCH)) { UHCI_STS_HCPE | UHCI_STS_HCH)) {
if (status & UHCI_STS_RD) { if (status & UHCI_STS_RD) {
#if USB_DEBUG #ifdef USB_DEBUG
printf("%s: resume detect\n", printf("%s: resume detect\n",
__FUNCTION__); __FUNCTION__);
#endif #endif
@ -1477,7 +1477,7 @@ uhci_interrupt(uhci_softc_t *sc)
/* no acknowledge needed */ /* no acknowledge needed */
DPRINTF("%s: host controller halted\n", DPRINTF("%s: host controller halted\n",
__FUNCTION__); __FUNCTION__);
#if USB_DEBUG #ifdef USB_DEBUG
if (uhcidebug > 0) { if (uhcidebug > 0) {
uhci_dump_all(sc); uhci_dump_all(sc);
} }
@ -1839,7 +1839,7 @@ uhci_setup_standard_chain(struct usb_xfer *xfer)
xfer->td_transfer_last = td; xfer->td_transfer_last = td;
#if USB_DEBUG #ifdef USB_DEBUG
if (uhcidebug > 8) { if (uhcidebug > 8) {
DPRINTF("nexttog=%d; data before transfer:\n", DPRINTF("nexttog=%d; data before transfer:\n",
xfer->endpoint->toggle_next); xfer->endpoint->toggle_next);
@ -2155,7 +2155,7 @@ uhci_device_isoc_enter(struct usb_xfer *xfer)
uint32_t temp; uint32_t temp;
uint32_t *plen; uint32_t *plen;
#if USB_DEBUG #ifdef USB_DEBUG
uint8_t once = 1; uint8_t once = 1;
#endif #endif
@ -2227,7 +2227,7 @@ uhci_device_isoc_enter(struct usb_xfer *xfer)
pp_last = &sc->sc_isoc_p_last[0]; pp_last = &sc->sc_isoc_p_last[0];
} }
if (*plen > xfer->max_frame_size) { if (*plen > xfer->max_frame_size) {
#if USB_DEBUG #ifdef USB_DEBUG
if (once) { if (once) {
once = 0; once = 0;
printf("%s: frame length(%d) exceeds %d " printf("%s: frame length(%d) exceeds %d "
@ -2279,7 +2279,7 @@ uhci_device_isoc_enter(struct usb_xfer *xfer)
usb_pc_cpu_flush(td->page_cache); usb_pc_cpu_flush(td->page_cache);
#if USB_DEBUG #ifdef USB_DEBUG
if (uhcidebug > 5) { if (uhcidebug > 5) {
DPRINTF("TD %d\n", nframes); DPRINTF("TD %d\n", nframes);
uhci_dump_td(td); uhci_dump_td(td);

View file

@ -77,7 +77,7 @@
#define USS820_DCI_PC2SC(pc) \ #define USS820_DCI_PC2SC(pc) \
USS820_DCI_BUS2SC(USB_DMATAG_TO_XROOT((pc)->tag_parent)->bus) USS820_DCI_BUS2SC(USB_DMATAG_TO_XROOT((pc)->tag_parent)->bus)
#if USB_DEBUG #ifdef USB_DEBUG
static int uss820dcidebug = 0; static int uss820dcidebug = 0;
SYSCTL_NODE(_hw_usb, OID_AUTO, uss820dci, CTLFLAG_RW, 0, "USB uss820dci"); SYSCTL_NODE(_hw_usb, OID_AUTO, uss820dci, CTLFLAG_RW, 0, "USB uss820dci");

View file

@ -116,7 +116,7 @@ __FBSDID("$FreeBSD$");
/* Tunables */ /* Tunables */
SYSCTL_NODE(_hw_usb, OID_AUTO, atp, CTLFLAG_RW, 0, "USB atp"); SYSCTL_NODE(_hw_usb, OID_AUTO, atp, CTLFLAG_RW, 0, "USB atp");
#if USB_DEBUG #ifdef USB_DEBUG
enum atp_log_level { enum atp_log_level {
ATP_LLEVEL_DISABLED = 0, ATP_LLEVEL_DISABLED = 0,
ATP_LLEVEL_ERROR, ATP_LLEVEL_ERROR,
@ -126,7 +126,7 @@ enum atp_log_level {
static int atp_debug = ATP_LLEVEL_ERROR; /* the default is to only log errors */ static int atp_debug = ATP_LLEVEL_ERROR; /* the default is to only log errors */
SYSCTL_INT(_hw_usb_atp, OID_AUTO, debug, CTLFLAG_RW, SYSCTL_INT(_hw_usb_atp, OID_AUTO, debug, CTLFLAG_RW,
&atp_debug, ATP_LLEVEL_ERROR, "ATP debug level"); &atp_debug, ATP_LLEVEL_ERROR, "ATP debug level");
#endif /* #if USB_DEBUG */ #endif /* USB_DEBUG */
static u_int atp_touch_timeout = ATP_TOUCH_TIMEOUT; static u_int atp_touch_timeout = ATP_TOUCH_TIMEOUT;
SYSCTL_INT(_hw_usb_atp, OID_AUTO, touch_timeout, CTLFLAG_RW, &atp_touch_timeout, SYSCTL_INT(_hw_usb_atp, OID_AUTO, touch_timeout, CTLFLAG_RW, &atp_touch_timeout,
@ -1055,7 +1055,7 @@ atp_update_strokes(struct atp_softc *sc, atp_pspan *pspans_x,
if (pspans_y[j].matched == FALSE) break; if (pspans_y[j].matched == FALSE) break;
} }
if ((i < n_xpspans) && (j < n_ypspans)) { if ((i < n_xpspans) && (j < n_ypspans)) {
#if USB_DEBUG #ifdef USB_DEBUG
if (atp_debug >= ATP_LLEVEL_INFO) { if (atp_debug >= ATP_LLEVEL_INFO) {
printf("unmatched pspans:"); printf("unmatched pspans:");
for (; i < n_xpspans; i++) { for (; i < n_xpspans; i++) {
@ -1072,7 +1072,7 @@ atp_update_strokes(struct atp_softc *sc, atp_pspan *pspans_x,
} }
printf("\n"); printf("\n");
} }
#endif /* #if USB_DEBUG */ #endif /* USB_DEBUG */
if ((n_xpspans == 1) && (n_ypspans == 1)) if ((n_xpspans == 1) && (n_ypspans == 1))
/* The common case of a single pair of new pspans. */ /* The common case of a single pair of new pspans. */
atp_add_stroke(sc, &pspans_x[0], &pspans_y[0]); atp_add_stroke(sc, &pspans_x[0], &pspans_y[0]);
@ -1082,7 +1082,7 @@ atp_update_strokes(struct atp_softc *sc, atp_pspan *pspans_x,
pspans_y, n_ypspans); pspans_y, n_ypspans);
} }
#if USB_DEBUG #ifdef USB_DEBUG
if (atp_debug >= ATP_LLEVEL_INFO) { if (atp_debug >= ATP_LLEVEL_INFO) {
for (i = 0; i < sc->sc_n_strokes; i++) { for (i = 0; i < sc->sc_n_strokes; i++) {
atp_stroke *stroke = &sc->sc_strokes[i]; atp_stroke *stroke = &sc->sc_strokes[i];
@ -1110,7 +1110,7 @@ atp_update_strokes(struct atp_softc *sc, atp_pspan *pspans_x,
if (sc->sc_n_strokes) if (sc->sc_n_strokes)
printf("\n"); printf("\n");
} }
#endif /* #if USB_DEBUG */ #endif /* USB_DEBUG */
return (movement); return (movement);
} }

View file

@ -76,7 +76,7 @@ __FBSDID("$FreeBSD$");
#include <dev/usb/input/usb_rdesc.h> #include <dev/usb/input/usb_rdesc.h>
#include <dev/usb/quirk/usb_quirk.h> #include <dev/usb/quirk/usb_quirk.h>
#if USB_DEBUG #ifdef USB_DEBUG
static int uhid_debug = 0; static int uhid_debug = 0;
SYSCTL_NODE(_hw_usb, OID_AUTO, uhid, CTLFLAG_RW, 0, "USB uhid"); SYSCTL_NODE(_hw_usb, OID_AUTO, uhid, CTLFLAG_RW, 0, "USB uhid");

View file

@ -88,7 +88,7 @@ __FBSDID("$FreeBSD$");
/* the following file must be included after "ukbdmap.h" */ /* the following file must be included after "ukbdmap.h" */
#include <dev/kbd/kbdtables.h> #include <dev/kbd/kbdtables.h>
#if USB_DEBUG #ifdef USB_DEBUG
static int ukbd_debug = 0; static int ukbd_debug = 0;
static int ukbd_no_leds = 0; static int ukbd_no_leds = 0;
@ -612,7 +612,7 @@ ukbd_intr_callback(struct usb_xfer *xfer, usb_error_t error)
apple_fn = 1; apple_fn = 1;
else else
apple_fn = 0; apple_fn = 0;
#if USB_DEBUG #ifdef USB_DEBUG
DPRINTF("apple_eject=%u apple_fn=%u\n", DPRINTF("apple_eject=%u apple_fn=%u\n",
apple_eject, apple_fn); apple_eject, apple_fn);
@ -678,7 +678,7 @@ ukbd_set_leds_callback(struct usb_xfer *xfer, usb_error_t error)
uint8_t buf[2]; uint8_t buf[2];
struct ukbd_softc *sc = usbd_xfer_softc(xfer); struct ukbd_softc *sc = usbd_xfer_softc(xfer);
#if USB_DEBUG #ifdef USB_DEBUG
if (ukbd_no_leds) if (ukbd_no_leds)
return; return;
#endif #endif

View file

@ -74,7 +74,7 @@ __FBSDID("$FreeBSD$");
#include <sys/tty.h> #include <sys/tty.h>
#include <sys/mouse.h> #include <sys/mouse.h>
#if USB_DEBUG #ifdef USB_DEBUG
static int ums_debug = 0; static int ums_debug = 0;
SYSCTL_NODE(_hw_usb, OID_AUTO, ums, CTLFLAG_RW, 0, "USB ums"); SYSCTL_NODE(_hw_usb, OID_AUTO, ums, CTLFLAG_RW, 0, "USB ums");
@ -494,7 +494,9 @@ ums_attach(device_t dev)
int err; int err;
uint16_t d_len; uint16_t d_len;
uint8_t i; uint8_t i;
#ifdef USB_DEBUG
uint8_t j; uint8_t j;
#endif
DPRINTFN(11, "sc=%p\n", sc); DPRINTFN(11, "sc=%p\n", sc);
@ -588,7 +590,7 @@ ums_attach(device_t dev)
free(d_ptr, M_TEMP); free(d_ptr, M_TEMP);
d_ptr = NULL; d_ptr = NULL;
#if USB_DEBUG #ifdef USB_DEBUG
for (j = 0; j < UMS_INFO_MAX; j++) { for (j = 0; j < UMS_INFO_MAX; j++) {
info = &sc->sc_info[j]; info = &sc->sc_info[j];

View file

@ -94,7 +94,7 @@ __FBSDID("$FreeBSD$");
#include <dev/usb/misc/udbp.h> #include <dev/usb/misc/udbp.h>
#if USB_DEBUG #ifdef USB_DEBUG
static int udbp_debug = 0; static int udbp_debug = 0;
SYSCTL_NODE(_hw_usb, OID_AUTO, udbp, CTLFLAG_RW, 0, "USB udbp"); SYSCTL_NODE(_hw_usb, OID_AUTO, udbp, CTLFLAG_RW, 0, "USB udbp");

View file

@ -100,7 +100,7 @@ __FBSDID("$FreeBSD$");
#include <dev/usb/net/usb_ethernet.h> #include <dev/usb/net/usb_ethernet.h>
#include <dev/usb/net/if_auereg.h> #include <dev/usb/net/if_auereg.h>
#if USB_DEBUG #ifdef USB_DEBUG
static int aue_debug = 0; static int aue_debug = 0;
SYSCTL_NODE(_hw_usb, OID_AUTO, aue, CTLFLAG_RW, 0, "USB aue"); SYSCTL_NODE(_hw_usb, OID_AUTO, aue, CTLFLAG_RW, 0, "USB aue");

View file

@ -123,7 +123,7 @@ __FBSDID("$FreeBSD$");
*/ */
#define AXE_178_MAX_FRAME_BURST 1 #define AXE_178_MAX_FRAME_BURST 1
#if USB_DEBUG #ifdef USB_DEBUG
static int axe_debug = 0; static int axe_debug = 0;
SYSCTL_NODE(_hw_usb, OID_AUTO, axe, CTLFLAG_RW, 0, "USB axe"); SYSCTL_NODE(_hw_usb, OID_AUTO, axe, CTLFLAG_RW, 0, "USB axe");

View file

@ -108,7 +108,7 @@ static uether_fn_t cdce_setpromisc;
static uint32_t cdce_m_crc32(struct mbuf *, uint32_t, uint32_t); static uint32_t cdce_m_crc32(struct mbuf *, uint32_t, uint32_t);
#if USB_DEBUG #ifdef USB_DEBUG
static int cdce_debug = 0; static int cdce_debug = 0;
SYSCTL_NODE(_hw_usb, OID_AUTO, cdce, CTLFLAG_RW, 0, "USB CDC-Ethernet"); SYSCTL_NODE(_hw_usb, OID_AUTO, cdce, CTLFLAG_RW, 0, "USB CDC-Ethernet");

View file

@ -122,7 +122,7 @@ static int cue_getmac(struct cue_softc *, void *);
static uint32_t cue_mchash(const uint8_t *); static uint32_t cue_mchash(const uint8_t *);
static void cue_reset(struct cue_softc *); static void cue_reset(struct cue_softc *);
#if USB_DEBUG #ifdef USB_DEBUG
static int cue_debug = 0; static int cue_debug = 0;
SYSCTL_NODE(_hw_usb, OID_AUTO, cue, CTLFLAG_RW, 0, "USB cue"); SYSCTL_NODE(_hw_usb, OID_AUTO, cue, CTLFLAG_RW, 0, "USB cue");

View file

@ -163,7 +163,7 @@ static int kue_ctl(struct kue_softc *, uint8_t, uint8_t, uint16_t,
static int kue_load_fw(struct kue_softc *); static int kue_load_fw(struct kue_softc *);
static void kue_reset(struct kue_softc *); static void kue_reset(struct kue_softc *);
#if USB_DEBUG #ifdef USB_DEBUG
static int kue_debug = 0; static int kue_debug = 0;
SYSCTL_NODE(_hw_usb, OID_AUTO, kue, CTLFLAG_RW, 0, "USB kue"); SYSCTL_NODE(_hw_usb, OID_AUTO, kue, CTLFLAG_RW, 0, "USB kue");

View file

@ -97,7 +97,7 @@ __FBSDID("$FreeBSD$");
#include <dev/usb/net/usb_ethernet.h> #include <dev/usb/net/usb_ethernet.h>
#include <dev/usb/net/if_ruereg.h> #include <dev/usb/net/if_ruereg.h>
#if USB_DEBUG #ifdef USB_DEBUG
static int rue_debug = 0; static int rue_debug = 0;
SYSCTL_NODE(_hw_usb, OID_AUTO, rue, CTLFLAG_RW, 0, "USB rue"); SYSCTL_NODE(_hw_usb, OID_AUTO, rue, CTLFLAG_RW, 0, "USB rue");

View file

@ -185,7 +185,7 @@ static const struct usb_ether_methods udav_ue_methods = {
.ue_mii_sts = udav_ifmedia_status, .ue_mii_sts = udav_ifmedia_status,
}; };
#if USB_DEBUG #ifdef USB_DEBUG
static int udav_debug = 0; static int udav_debug = 0;
SYSCTL_NODE(_hw_usb, OID_AUTO, udav, CTLFLAG_RW, 0, "USB udav"); SYSCTL_NODE(_hw_usb, OID_AUTO, udav, CTLFLAG_RW, 0, "USB udav");

View file

@ -63,7 +63,7 @@
#include <dev/usb/serial/usb_serial.h> #include <dev/usb/serial/usb_serial.h>
#if USB_DEBUG #ifdef USB_DEBUG
static int u3g_debug = 0; static int u3g_debug = 0;
SYSCTL_NODE(_hw_usb, OID_AUTO, u3g, CTLFLAG_RW, 0, "USB 3g"); SYSCTL_NODE(_hw_usb, OID_AUTO, u3g, CTLFLAG_RW, 0, "USB 3g");

View file

@ -93,7 +93,7 @@ __FBSDID("$FreeBSD$");
#include <dev/usb/serial/usb_serial.h> #include <dev/usb/serial/usb_serial.h>
#if USB_DEBUG #ifdef USB_DEBUG
static int ubsa_debug = 0; static int ubsa_debug = 0;
SYSCTL_NODE(_hw_usb, OID_AUTO, ubsa, CTLFLAG_RW, 0, "USB ubsa"); SYSCTL_NODE(_hw_usb, OID_AUTO, ubsa, CTLFLAG_RW, 0, "USB ubsa");
@ -405,9 +405,8 @@ ubsa_cfg_set_break(struct ucom_softc *ucom, uint8_t onoff)
static int static int
ubsa_pre_param(struct ucom_softc *ucom, struct termios *t) ubsa_pre_param(struct ucom_softc *ucom, struct termios *t)
{ {
struct ubsa_softc *sc = ucom->sc_parent;
DPRINTF("sc = %p\n", sc); DPRINTF("sc = %p\n", ucom->sc_parent);
switch (t->c_ospeed) { switch (t->c_ospeed) {
case B0: case B0:

View file

@ -115,7 +115,7 @@ __FBSDID("$FreeBSD$");
#define VENDOR_SET_BREAK 0x02 #define VENDOR_SET_BREAK 0x02
#define VENDOR_CLEAR_BREAK 0x03 #define VENDOR_CLEAR_BREAK 0x03
#if USB_DEBUG #ifdef USB_DEBUG
static int ubser_debug = 0; static int ubser_debug = 0;
SYSCTL_NODE(_hw_usb, OID_AUTO, ubser, CTLFLAG_RW, 0, "USB ubser"); SYSCTL_NODE(_hw_usb, OID_AUTO, ubser, CTLFLAG_RW, 0, "USB ubser");

View file

@ -101,7 +101,7 @@ __FBSDID("$FreeBSD$");
#include <dev/usb/serial/usb_serial.h> #include <dev/usb/serial/usb_serial.h>
#if USB_DEBUG #ifdef USB_DEBUG
static int uchcom_debug = 0; static int uchcom_debug = 0;
SYSCTL_NODE(_hw_usb, OID_AUTO, uchcom, CTLFLAG_RW, 0, "USB uchcom"); SYSCTL_NODE(_hw_usb, OID_AUTO, uchcom, CTLFLAG_RW, 0, "USB uchcom");

View file

@ -73,7 +73,7 @@ __FBSDID("$FreeBSD$");
#include <dev/usb/serial/usb_serial.h> #include <dev/usb/serial/usb_serial.h>
#include <dev/usb/serial/uftdi_reg.h> #include <dev/usb/serial/uftdi_reg.h>
#if USB_DEBUG #ifdef USB_DEBUG
static int uftdi_debug = 0; static int uftdi_debug = 0;
SYSCTL_NODE(_hw_usb, OID_AUTO, uftdi, CTLFLAG_RW, 0, "USB uftdi"); SYSCTL_NODE(_hw_usb, OID_AUTO, uftdi, CTLFLAG_RW, 0, "USB uftdi");

View file

@ -72,7 +72,7 @@ __FBSDID("$FreeBSD$");
#include <dev/usb/usb_debug.h> #include <dev/usb/usb_debug.h>
#include <dev/usb/usb_process.h> #include <dev/usb/usb_process.h>
#if USB_DEBUG #ifdef USB_DEBUG
static int ulpt_debug = 0; static int ulpt_debug = 0;
SYSCTL_NODE(_hw_usb, OID_AUTO, ulpt, CTLFLAG_RW, 0, "USB ulpt"); SYSCTL_NODE(_hw_usb, OID_AUTO, ulpt, CTLFLAG_RW, 0, "USB ulpt");

View file

@ -116,7 +116,7 @@ __FBSDID("$FreeBSD$");
#include <dev/usb/serial/usb_serial.h> #include <dev/usb/serial/usb_serial.h>
#if USB_DEBUG #ifdef USB_DEBUG
static int umodem_debug = 0; static int umodem_debug = 0;
SYSCTL_NODE(_hw_usb, OID_AUTO, umodem, CTLFLAG_RW, 0, "USB umodem"); SYSCTL_NODE(_hw_usb, OID_AUTO, umodem, CTLFLAG_RW, 0, "USB umodem");

View file

@ -48,7 +48,7 @@
#include <dev/usb/serial/usb_serial.h> #include <dev/usb/serial/usb_serial.h>
#if USB_DEBUG #ifdef USB_DEBUG
static int umoscom_debug = 0; static int umoscom_debug = 0;
SYSCTL_NODE(_hw_usb, OID_AUTO, umoscom, CTLFLAG_RW, 0, "USB umoscom"); SYSCTL_NODE(_hw_usb, OID_AUTO, umoscom, CTLFLAG_RW, 0, "USB umoscom");

View file

@ -116,7 +116,7 @@ __FBSDID("$FreeBSD$");
#include <dev/usb/serial/usb_serial.h> #include <dev/usb/serial/usb_serial.h>
#if USB_DEBUG #ifdef USB_DEBUG
static int uplcom_debug = 0; static int uplcom_debug = 0;
SYSCTL_NODE(_hw_usb, OID_AUTO, uplcom, CTLFLAG_RW, 0, "USB uplcom"); SYSCTL_NODE(_hw_usb, OID_AUTO, uplcom, CTLFLAG_RW, 0, "USB uplcom");

View file

@ -104,7 +104,7 @@ __FBSDID("$FreeBSD$");
SYSCTL_NODE(_hw_usb, OID_AUTO, ucom, CTLFLAG_RW, 0, "USB ucom"); SYSCTL_NODE(_hw_usb, OID_AUTO, ucom, CTLFLAG_RW, 0, "USB ucom");
#if USB_DEBUG #ifdef USB_DEBUG
static int ucom_debug = 0; static int ucom_debug = 0;
SYSCTL_INT(_hw_usb_ucom, OID_AUTO, debug, CTLFLAG_RW, SYSCTL_INT(_hw_usb_ucom, OID_AUTO, debug, CTLFLAG_RW,

View file

@ -50,7 +50,7 @@ __FBSDID("$FreeBSD$");
#include <dev/usb/serial/usb_serial.h> #include <dev/usb/serial/usb_serial.h>
#if USB_DEBUG #ifdef USB_DEBUG
static int uslcom_debug = 0; static int uslcom_debug = 0;
SYSCTL_NODE(_hw_usb, OID_AUTO, uslcom, CTLFLAG_RW, 0, "USB uslcom"); SYSCTL_NODE(_hw_usb, OID_AUTO, uslcom, CTLFLAG_RW, 0, "USB uslcom");

View file

@ -78,7 +78,7 @@
#include <dev/usb/serial/usb_serial.h> #include <dev/usb/serial/usb_serial.h>
#if USB_DEBUG #ifdef USB_DEBUG
static int uvisor_debug = 0; static int uvisor_debug = 0;
SYSCTL_NODE(_hw_usb, OID_AUTO, uvisor, CTLFLAG_RW, 0, "USB uvisor"); SYSCTL_NODE(_hw_usb, OID_AUTO, uvisor, CTLFLAG_RW, 0, "USB uvisor");
@ -392,7 +392,7 @@ uvisor_init(struct uvisor_softc *sc, struct usb_device *udev, struct usb_config
goto done; goto done;
} }
} }
#if USB_DEBUG #ifdef USB_DEBUG
if (sc->sc_flag & UVISOR_FLAG_VISOR) { if (sc->sc_flag & UVISOR_FLAG_VISOR) {
uint16_t i, np; uint16_t i, np;
const char *desc; const char *desc;

View file

@ -68,7 +68,7 @@ __FBSDID("$FreeBSD$");
#include <dev/usb/serial/usb_serial.h> #include <dev/usb/serial/usb_serial.h>
#if USB_DEBUG #ifdef USB_DEBUG
static int uvscom_debug = 0; static int uvscom_debug = 0;
SYSCTL_NODE(_hw_usb, OID_AUTO, uvscom, CTLFLAG_RW, 0, "USB uvscom"); SYSCTL_NODE(_hw_usb, OID_AUTO, uvscom, CTLFLAG_RW, 0, "USB uvscom");

View file

@ -146,7 +146,7 @@ __FBSDID("$FreeBSD$");
#define UMASS_USB_FLAGS #define UMASS_USB_FLAGS
#endif #endif
#if USB_DEBUG #ifdef USB_DEBUG
#define DIF(m, x) \ #define DIF(m, x) \
do { \ do { \
if (umass_debug & (m)) { x ; } \ if (umass_debug & (m)) { x ; } \
@ -488,7 +488,7 @@ static uint8_t umass_no_transform(struct umass_softc *, uint8_t *, uint8_t);
static uint8_t umass_std_transform(struct umass_softc *, union ccb *, uint8_t static uint8_t umass_std_transform(struct umass_softc *, union ccb *, uint8_t
*, uint8_t); *, uint8_t);
#if USB_DEBUG #ifdef USB_DEBUG
static void umass_bbb_dump_cbw(struct umass_softc *, umass_bbb_cbw_t *); static void umass_bbb_dump_cbw(struct umass_softc *, umass_bbb_cbw_t *);
static void umass_bbb_dump_csw(struct umass_softc *, umass_bbb_csw_t *); static void umass_bbb_dump_csw(struct umass_softc *, umass_bbb_csw_t *);
static void umass_cbi_dump_cmd(struct umass_softc *, void *, uint8_t); static void umass_cbi_dump_cmd(struct umass_softc *, void *, uint8_t);
@ -917,7 +917,7 @@ umass_attach(device_t dev)
} }
sc->sc_iface_no = id->bInterfaceNumber; sc->sc_iface_no = id->bInterfaceNumber;
#if USB_DEBUG #ifdef USB_DEBUG
device_printf(dev, " "); device_printf(dev, " ");
switch (sc->sc_proto & UMASS_PROTO_COMMAND) { switch (sc->sc_proto & UMASS_PROTO_COMMAND) {
@ -3012,7 +3012,7 @@ umass_std_transform(struct umass_softc *sc, union ccb *ccb,
return (1); return (1);
} }
#if USB_DEBUG #ifdef USB_DEBUG
static void static void
umass_bbb_dump_cbw(struct umass_softc *sc, umass_bbb_cbw_t *cbw) umass_bbb_dump_cbw(struct umass_softc *sc, umass_bbb_cbw_t *cbw)
{ {

View file

@ -78,7 +78,7 @@ __FBSDID("$FreeBSD$");
#include <dev/usb/storage/rio500_usb.h> #include <dev/usb/storage/rio500_usb.h>
#if USB_DEBUG #ifdef USB_DEBUG
static int urio_debug = 0; static int urio_debug = 0;
SYSCTL_NODE(_hw_usb, OID_AUTO, urio, CTLFLAG_RW, 0, "USB urio"); SYSCTL_NODE(_hw_usb, OID_AUTO, urio, CTLFLAG_RW, 0, "USB urio");

View file

@ -64,7 +64,7 @@
#define USB_DEBUG_VAR ustorage_fs_debug #define USB_DEBUG_VAR ustorage_fs_debug
#include <dev/usb/usb_debug.h> #include <dev/usb/usb_debug.h>
#if USB_DEBUG #ifdef USB_DEBUG
static int ustorage_fs_debug = 0; static int ustorage_fs_debug = 0;
SYSCTL_NODE(_hw_usb, OID_AUTO, ustorage_fs, CTLFLAG_RW, 0, "USB ustorage_fs"); SYSCTL_NODE(_hw_usb, OID_AUTO, ustorage_fs, CTLFLAG_RW, 0, "USB ustorage_fs");

View file

@ -34,7 +34,7 @@ extern int usb_debug;
/* Check if USB debugging is enabled. */ /* Check if USB debugging is enabled. */
#ifdef USB_DEBUG_VAR #ifdef USB_DEBUG_VAR
#if (USB_DEBUG != 0) #ifdef USB_DEBUG
#define DPRINTFN(n,fmt,...) do { \ #define DPRINTFN(n,fmt,...) do { \
if ((USB_DEBUG_VAR) >= (n)) { \ if ((USB_DEBUG_VAR) >= (n)) { \
printf("%s: " fmt, \ printf("%s: " fmt, \

View file

@ -57,10 +57,6 @@
#define USB_HUB_MAX_DEPTH 5 #define USB_HUB_MAX_DEPTH 5
#define USB_EP0_BUFSIZE 1024 /* bytes */ #define USB_EP0_BUFSIZE 1024 /* bytes */
#ifndef USB_DEBUG
#define USB_DEBUG 1
#endif
typedef uint32_t usb_timeout_t; /* milliseconds */ typedef uint32_t usb_timeout_t; /* milliseconds */
typedef uint32_t usb_frlength_t; /* bytes */ typedef uint32_t usb_frlength_t; /* bytes */
typedef uint32_t usb_frcount_t; /* units */ typedef uint32_t usb_frcount_t; /* units */

View file

@ -68,7 +68,7 @@
#include <dev/usb/usb_bus.h> #include <dev/usb/usb_bus.h>
#include <sys/ctype.h> #include <sys/ctype.h>
#if USB_DEBUG #ifdef USB_DEBUG
static int usb_pr_poll_delay = USB_PORT_RESET_DELAY; static int usb_pr_poll_delay = USB_PORT_RESET_DELAY;
static int usb_pr_recovery_delay = USB_PORT_RESET_RECOVERY; static int usb_pr_recovery_delay = USB_PORT_RESET_RECOVERY;
static int usb_ss_delay = 0; static int usb_ss_delay = 0;
@ -433,7 +433,7 @@ usbd_do_request_flags(struct usb_device *udev, struct mtx *mtx,
} else { } else {
if (xfer->frlengths[0] == 0) { if (xfer->frlengths[0] == 0) {
if (xfer->flags.manual_status) { if (xfer->flags.manual_status) {
#if USB_DEBUG #ifdef USB_DEBUG
int temp; int temp;
temp = usb_ss_delay; temp = usb_ss_delay;
@ -603,7 +603,7 @@ usbd_req_reset_port(struct usb_device *udev, struct mtx *mtx, uint8_t port)
usb_error_t err; usb_error_t err;
uint16_t n; uint16_t n;
#if USB_DEBUG #ifdef USB_DEBUG
uint16_t pr_poll_delay; uint16_t pr_poll_delay;
uint16_t pr_recovery_delay; uint16_t pr_recovery_delay;
@ -612,7 +612,7 @@ usbd_req_reset_port(struct usb_device *udev, struct mtx *mtx, uint8_t port)
if (err) { if (err) {
goto done; goto done;
} }
#if USB_DEBUG #ifdef USB_DEBUG
/* range check input parameters */ /* range check input parameters */
pr_poll_delay = usb_pr_poll_delay; pr_poll_delay = usb_pr_poll_delay;
if (pr_poll_delay < 1) { if (pr_poll_delay < 1) {
@ -627,7 +627,7 @@ usbd_req_reset_port(struct usb_device *udev, struct mtx *mtx, uint8_t port)
#endif #endif
n = 0; n = 0;
while (1) { while (1) {
#if USB_DEBUG #ifdef USB_DEBUG
/* wait for the device to recover from reset */ /* wait for the device to recover from reset */
usb_pause_mtx(mtx, USB_MS_TO_TICKS(pr_poll_delay)); usb_pause_mtx(mtx, USB_MS_TO_TICKS(pr_poll_delay));
n += pr_poll_delay; n += pr_poll_delay;
@ -666,7 +666,7 @@ usbd_req_reset_port(struct usb_device *udev, struct mtx *mtx, uint8_t port)
err = USB_ERR_TIMEOUT; err = USB_ERR_TIMEOUT;
goto done; goto done;
} }
#if USB_DEBUG #ifdef USB_DEBUG
/* wait for the device to recover from reset */ /* wait for the device to recover from reset */
usb_pause_mtx(mtx, USB_MS_TO_TICKS(pr_recovery_delay)); usb_pause_mtx(mtx, USB_MS_TO_TICKS(pr_recovery_delay));
#else #else

View file

@ -1418,7 +1418,7 @@ usbd_transfer_submit(struct usb_xfer *xfer)
xfer, xfer->endpoint, xfer->nframes, USB_GET_DATA_ISREAD(xfer) ? xfer, xfer->endpoint, xfer->nframes, USB_GET_DATA_ISREAD(xfer) ?
"read" : "write"); "read" : "write");
#if USB_DEBUG #ifdef USB_DEBUG
if (USB_DEBUG_VAR > 0) { if (USB_DEBUG_VAR > 0) {
USB_BUS_LOCK(bus); USB_BUS_LOCK(bus);

View file

@ -77,7 +77,7 @@ __FBSDID("$FreeBSD$");
#include <dev/usb/wlan/if_rumvar.h> #include <dev/usb/wlan/if_rumvar.h>
#include <dev/usb/wlan/if_rumfw.h> #include <dev/usb/wlan/if_rumfw.h>
#if USB_DEBUG #ifdef USB_DEBUG
static int rum_debug = 0; static int rum_debug = 0;
SYSCTL_NODE(_hw_usb, OID_AUTO, rum, CTLFLAG_RW, 0, "USB rum"); SYSCTL_NODE(_hw_usb, OID_AUTO, rum, CTLFLAG_RW, 0, "USB rum");

View file

@ -79,7 +79,7 @@ __FBSDID("$FreeBSD$");
#define nitems(_a) (sizeof((_a)) / sizeof((_a)[0])) #define nitems(_a) (sizeof((_a)) / sizeof((_a)[0]))
#if USB_DEBUG #ifdef USB_DEBUG
#define RUN_DEBUG #define RUN_DEBUG
#endif #endif

View file

@ -78,7 +78,7 @@ __FBSDID("$FreeBSD$");
#include <dev/usb/wlan/if_uralreg.h> #include <dev/usb/wlan/if_uralreg.h>
#include <dev/usb/wlan/if_uralvar.h> #include <dev/usb/wlan/if_uralvar.h>
#if USB_DEBUG #ifdef USB_DEBUG
static int ural_debug = 0; static int ural_debug = 0;
SYSCTL_NODE(_hw_usb, OID_AUTO, ural, CTLFLAG_RW, 0, "USB ural"); SYSCTL_NODE(_hw_usb, OID_AUTO, ural, CTLFLAG_RW, 0, "USB ural");

View file

@ -75,7 +75,7 @@ __FBSDID("$FreeBSD$");
#include <dev/usb/wlan/if_zydreg.h> #include <dev/usb/wlan/if_zydreg.h>
#include <dev/usb/wlan/if_zydfw.h> #include <dev/usb/wlan/if_zydfw.h>
#if USB_DEBUG #ifdef USB_DEBUG
static int zyd_debug = 0; static int zyd_debug = 0;
SYSCTL_NODE(_hw_usb, OID_AUTO, zyd, CTLFLAG_RW, 0, "USB zyd"); SYSCTL_NODE(_hw_usb, OID_AUTO, zyd, CTLFLAG_RW, 0, "USB zyd");

View file

@ -294,6 +294,7 @@ device firmware # firmware assist module
device bpf # Berkeley packet filter device bpf # Berkeley packet filter
# USB support # USB support
options USB_DEBUG # enable debug msgs
device uhci # UHCI PCI->USB interface device uhci # UHCI PCI->USB interface
device ohci # OHCI PCI->USB interface device ohci # OHCI PCI->USB interface
device ehci # EHCI PCI->USB interface (USB 2.0) device ehci # EHCI PCI->USB interface (USB 2.0)

View file

@ -82,6 +82,7 @@ device pty # BSD-style compatibility pseudo ttys
device bpf # Berkeley packet filter device bpf # Berkeley packet filter
# USB support # USB support
options USB_DEBUG # enable debug msgs
#device uhci # UHCI PCI->USB interface #device uhci # UHCI PCI->USB interface
device ohci # OHCI PCI->USB interface device ohci # OHCI PCI->USB interface
device usb # USB Bus (required) device usb # USB Bus (required)

View file

@ -116,6 +116,7 @@ device ida # Compaq Smart RAID
device mlx # Mylex DAC960 family device mlx # Mylex DAC960 family
# USB host controllers and peripherals # USB host controllers and peripherals
options USB_DEBUG # enable debug msgs
device ehci # EHCI host controller device ehci # EHCI host controller
device ohci # OHCI PCI->USB interface device ohci # OHCI PCI->USB interface
device uhci # UHCI PCI->USB interface device uhci # UHCI PCI->USB interface

View file

@ -75,6 +75,7 @@ device pci # siba_pcib
#device ath_hal # pci chip support #device ath_hal # pci chip support
#options AH_SUPPORT_AR5416 # enable AR5416 tx/rx descriptors #options AH_SUPPORT_AR5416 # enable AR5416 tx/rx descriptors
options USB_DEBUG # enable debug msgs
device usb # USB Bus (required) device usb # USB Bus (required)
device uhci # UHCI PCI->USB interface device uhci # UHCI PCI->USB interface
device ehci # EHCI PCI->USB interface (USB 2.0) device ehci # EHCI PCI->USB interface (USB 2.0)

View file

@ -132,6 +132,7 @@ device scbus
#device ohci # OHCI PCI->USB interface #device ohci # OHCI PCI->USB interface
device ehci # EHCI PCI->USB interface (USB 2.0) device ehci # EHCI PCI->USB interface (USB 2.0)
device usb # USB Bus (required) device usb # USB Bus (required)
options USB_DEBUG # enable debug msgs
#device udbp # USB Double Bulk Pipe devices #device udbp # USB Double Bulk Pipe devices
#device ugen # Generic #device ugen # Generic
#device uhid # "Human Interface Devices" #device uhid # "Human Interface Devices"

View file

@ -247,6 +247,7 @@ device firmware # firmware assist module
device bpf # Berkeley packet filter device bpf # Berkeley packet filter
# USB support # USB support
#options USB_DEBUG # enable debug msgs
#device uhci # UHCI PCI->USB interface #device uhci # UHCI PCI->USB interface
#device ohci # OHCI PCI->USB interface #device ohci # OHCI PCI->USB interface
#device ehci # EHCI PCI->USB interface (USB 2.0) #device ehci # EHCI PCI->USB interface (USB 2.0)

View file

@ -144,6 +144,7 @@ device firmware # firmware assist module
device bpf #Berkeley packet filter device bpf #Berkeley packet filter
# USB support # USB support
options USB_DEBUG # enable debug msgs
device uhci # UHCI PCI->USB interface device uhci # UHCI PCI->USB interface
device ohci # OHCI PCI->USB interface device ohci # OHCI PCI->USB interface
device ehci # EHCI PCI->USB interface device ehci # EHCI PCI->USB interface

View file

@ -79,6 +79,7 @@ device sec
device tsec device tsec
device tun device tun
device uart device uart
options USB_DEBUG # enable debug msgs
#device uhci #device uhci
device umass device umass
device usb device usb

View file

@ -226,6 +226,7 @@ device firmware # firmware assist module
device bpf # Berkeley packet filter device bpf # Berkeley packet filter
# USB support # USB support
options USB_DEBUG # enable debug msgs
device uhci # UHCI PCI->USB interface device uhci # UHCI PCI->USB interface
device ohci # OHCI PCI->USB interface device ohci # OHCI PCI->USB interface
device ehci # EHCI PCI->USB interface (USB 2.0) device ehci # EHCI PCI->USB interface (USB 2.0)

View file

@ -183,6 +183,7 @@ device faith # IPv6-to-IPv4 relaying (translation)
device bpf # Berkeley packet filter device bpf # Berkeley packet filter
# USB support # USB support
options USB_DEBUG # enable debug msgs
#device uhci # UHCI PCI->USB interface #device uhci # UHCI PCI->USB interface
#device ohci # OHCI PCI->USB interface #device ohci # OHCI PCI->USB interface
device usb # USB Bus (required) device usb # USB Bus (required)