make compile without USB_DEBUG, wrap lines to 80 cols

This commit is contained in:
drochner 1998-12-09 19:24:28 +00:00
parent 3a8728fa4f
commit 35345a1311
2 changed files with 44 additions and 25 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: uhub.c,v 1.9 1998/12/09 01:01:24 augustss Exp $ */
/* $NetBSD: uhub.c,v 1.10 1998/12/09 19:24:28 drochner Exp $ */
/*
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@ -135,8 +135,8 @@ uhub_attach(parent, self, aux)
r = usbd_set_config_index(dev, 0, 1);
if (r != USBD_NORMAL_COMPLETION) {
printf("%s: configuration failed, error=%d(%s)\n",
sc->sc_dev.dv_xname, r, usbd_error_strs[r]);
DPRINTF(("%s: configuration failed, error=%d(%s)\n",
sc->sc_dev.dv_xname, r, usbd_error_strs[r]));
return;
}
@ -156,8 +156,8 @@ uhub_attach(parent, self, aux)
/* XXX not correct for hubs with >7 ports */
r = usbd_do_request(dev, &req, &hubdesc);
if (r != USBD_NORMAL_COMPLETION) {
printf("%s: getting hub descriptor failed, error=%d(%s)\n",
sc->sc_dev.dv_xname, r, usbd_error_strs[r]);
DPRINTF(("%s: getting hub descriptor failed, error=%d(%s)\n",
sc->sc_dev.dv_xname, r, usbd_error_strs[r]));
return;
}
@ -171,13 +171,15 @@ uhub_attach(parent, self, aux)
hub->explore = uhub_explore;
hub->hubdesc = hubdesc;
DPRINTFN(1,("usbhub_init_hub: selfpowered=%d, parent=%p, parent->selfpowered=%d\n",
DPRINTFN(1,("usbhub_init_hub: selfpowered=%d, parent=%p, "
"parent->selfpowered=%d\n",
dev->self_powered, dev->powersrc->parent,
dev->powersrc->parent ?
dev->powersrc->parent->self_powered : 0));
if (!dev->self_powered && dev->powersrc->parent &&
!dev->powersrc->parent->self_powered) {
printf("%s: bus powered hub connected to bus powered hub, ignored\n",
printf("%s: bus powered hub connected to bus powered hub, "
"ignored\n",
sc->sc_dev.dv_xname);
return;
}
@ -231,7 +233,8 @@ uhub_init_port(port, uport, dev)
if (r != USBD_NORMAL_COMPLETION)
return r;
pstatus = UGETW(uport->status.wPortStatus);
DPRINTF(("usbd_init_port: adding hub port=%d status=0x%04x change=0x%04x\n",
DPRINTF(("usbd_init_port: adding hub port=%d status=0x%04x "
"change=0x%04x\n",
port, pstatus, UGETW(uport->status.wPortChange)));
if ((pstatus & UPS_PORT_POWER) == 0) {
/* Port lacks power, turn it on */
@ -246,7 +249,8 @@ uhub_init_port(port, uport, dev)
r = usbd_get_port_status(dev, port, &uport->status);
if (r != USBD_NORMAL_COMPLETION)
return (r);
DPRINTF(("usb_init_port: turn on port %d power status=0x%04x change=0x%04x\n",
DPRINTF(("usb_init_port: turn on port %d power status=0x%04x "
"change=0x%04x\n",
port, UGETW(uport->status.wPortStatus),
UGETW(uport->status.wPortChange)));
/* Wait for stable power. */
@ -286,7 +290,8 @@ uhub_explore(parent, dev)
up = &dev->hub->ports[port-1];
r = usbd_get_port_status(dev, port, &up->status);
if (r != USBD_NORMAL_COMPLETION) {
DPRINTF(("uhub_explore: get port status failed, error=%d(%s)\n",
DPRINTF(("uhub_explore: get port status failed, "
"error=%d(%s)\n",
r, usbd_error_strs[r]));
continue;
}
@ -313,7 +318,8 @@ uhub_explore(parent, dev)
*/
if (up->device) {
/* Disconnected */
DPRINTF(("uhub_explore: device %d disappeared on port %d\n",
DPRINTF(("uhub_explore: device %d disappeared "
"on port %d\n",
up->device->address, port));
uhub_disconnect(sc, parent, up, port);
usbd_clear_port_feature(dev, port,
@ -339,7 +345,8 @@ uhub_explore(parent, dev)
port, up);
/* XXX retry a few times? */
if (r != USBD_NORMAL_COMPLETION) {
DPRINTFN(-1,("uhub_explore: usb_new_device failed, error=%d(%s)\n", r, usbd_error_strs[r]));
DPRINTFN(-1,("uhub_explore: usb_new_device failed, "
"error=%d(%s)\n", r, usbd_error_strs[r]));
/* Avoid addressing problems by disabling. */
/* usbd_reset_port(dev, port, &up->status); */
/* XXX
@ -353,7 +360,8 @@ uhub_explore(parent, dev)
* address, and since we cannot leave
* at 0 we have to disable the port
* instead. */
printf("%s: device problem, disabling port %d\n",
printf("%s: device problem, disabling "
"port %d\n",
parent->dv_xname, port);
usbd_clear_port_feature(dev, port,
UHF_PORT_ENABLE);

View File

@ -1,4 +1,4 @@
/* $NetBSD: usb_subr.c,v 1.13 1998/12/09 00:18:11 augustss Exp $ */
/* $NetBSD: usb_subr.c,v 1.14 1998/12/09 19:24:28 drochner Exp $ */
/*
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@ -387,7 +387,8 @@ usbd_fill_iface_data(dev, ifaceidx, altidx)
int endpt, nendpt;
usbd_status r;
DPRINTFN(5,("usbd_fill_iface_data: ifaceidx=%d altidx=%d\n", ifaceidx, altidx));
DPRINTFN(5,("usbd_fill_iface_data: ifaceidx=%d altidx=%d\n",
ifaceidx, altidx));
ifc->device = dev;
ifc->idesc = usbd_find_idesc(dev->cdesc, ifaceidx, altidx);
ifc->index = ifaceidx;
@ -410,7 +411,8 @@ usbd_fill_iface_data(dev, ifaceidx, altidx)
DPRINTFN(10,("usbd_fill_iface_data: endpt=%d\n", endpt));
for (; p < end; p += ed->bLength) {
ed = (usb_endpoint_descriptor_t *)p;
DPRINTFN(10,("usbd_fill_iface_data: p=%p end=%p len=%d type=%d\n",
DPRINTFN(10,("usbd_fill_iface_data: p=%p end=%p "
"len=%d type=%d\n",
p, end, ed->bLength, ed->bDescriptorType));
if (p + ed->bLength <= end &&
ed->bDescriptorType == UDESC_ENDPOINT)
@ -538,12 +540,14 @@ usbd_set_config_index(dev, index, msg)
(UGETW(ds.wStatus) & UDS_SELF_POWERED))
selfpowered = 1;
}
DPRINTF(("usbd_set_config_index: status=0x%04x, error=%d(%s)\n",
DPRINTF(("usbd_set_config_index: status=0x%04x, "
"error=%d(%s)\n",
UGETW(ds.wStatus), r, usbd_error_strs[r]));
} else
selfpowered = 1;
}
DPRINTF(("usbd_set_config_index: (addr %d) attr=0x%02x, selfpowered=%d, power=%d, powerquirk=%x\n",
DPRINTF(("usbd_set_config_index: (addr %d) attr=0x%02x, "
"selfpowered=%d, power=%d, powerquirk=%x\n",
dev->address, cdp->bmAttributes,
selfpowered, cdp->bMaxPower * 2,
dev->quirks->uq_flags & UQ_HUB_POWER));
@ -557,7 +561,8 @@ usbd_set_config_index(dev, index, msg)
if (power > dev->powersrc->power) {
/* XXX print nicer message. */
if (msg)
printf("%s: device addr %d (config %d) exceeds power budget, %d mA > %d mA\n",
printf("%s: device addr %d (config %d) exceeds "
"power budget, %d mA > %d mA\n",
dev->bus->bdev.dv_xname, dev->address,
cdp->bConfigurationValue,
power, dev->powersrc->power);
@ -569,7 +574,8 @@ usbd_set_config_index(dev, index, msg)
r = usbd_set_config(dev, cdp->bConfigurationValue);
if (r != USBD_NORMAL_COMPLETION) {
DPRINTF(("usbd_set_config_index: setting config=%d failed, error=%d(%s)\n",
DPRINTF(("usbd_set_config_index: setting config=%d failed, "
"error=%d(%s)\n",
cdp->bConfigurationValue, r, usbd_error_strs[r]));
goto bad;
}
@ -737,12 +743,14 @@ usbd_new_device(parent, bus, depth, lowspeed, port, up)
usbd_delay_ms(dev->bus, 200);
}
if (r != USBD_NORMAL_COMPLETION) {
DPRINTFN(-1, ("usbd_new_device: addr=%d, getting first desc failed\n",
DPRINTFN(-1, ("usbd_new_device: addr=%d, getting first desc "
"failed\n",
addr));
goto bad;
}
DPRINTF(("usbd_new_device: adding unit addr=%d, rev=%02x, class=%d, subclass=%d, protocol=%d, maxpacket=%d, ls=%d\n",
DPRINTF(("usbd_new_device: adding unit addr=%d, rev=%02x, class=%d, "
"subclass=%d, protocol=%d, maxpacket=%d, ls=%d\n",
addr, UGETW(d->bcdUSB), d->bDeviceClass, d->bDeviceSubClass,
d->bDeviceProtocol, d->bMaxPacketSize, dev->lowspeed));
@ -751,7 +759,8 @@ usbd_new_device(parent, bus, depth, lowspeed, port, up)
/* Get the full device descriptor. */
r = usbd_get_device_desc(dev, d);
if (r != USBD_NORMAL_COMPLETION) {
DPRINTFN(-1, ("usbd_new_device: addr=%d, getting full desc failed\n", addr));
DPRINTFN(-1, ("usbd_new_device: addr=%d, getting full desc "
"failed\n", addr));
goto bad;
}
@ -793,8 +802,10 @@ usbd_new_device(parent, bus, depth, lowspeed, port, up)
DPRINTFN(1,("usbd_new_device: trying config idx=%d\n", confi));
r = usbd_set_config_index(dev, confi, 1);
if (r != USBD_NORMAL_COMPLETION) {
printf("%s: set config at addr %d failed, error=%d(%s)\n",
parent->dv_xname, addr, r, usbd_error_strs[r]);
DPRINTF(("%s: set config at addr %d failed, "
"error=%d(%s)\n",
parent->dv_xname, addr, r,
usbd_error_strs[r]));
goto bad;
}
uaa.configno = confi;