Textual changes
This commit is contained in:
parent
5602b5091c
commit
235dddd4ea
@ -1,5 +1,5 @@
|
||||
/* $NetBSD: hid.c,v 1.7 1999/01/08 11:58:25 augustss Exp $ */
|
||||
/* FreeBSD $Id: hid.c,v 1.5 1999/01/07 23:31:29 n_hibma Exp $ */
|
||||
/* $FreeBSD$ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1998 The NetBSD Foundation, Inc.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* $NetBSD: hid.h,v 1.3 1998/11/25 22:32:04 augustss Exp $ */
|
||||
/* FreeBSD $Id$ */
|
||||
/* $FreeBSD$ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1998 The NetBSD Foundation, Inc.
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: ohci.c,v 1.23 1999/01/07 02:06:05 augustss Exp $ */
|
||||
/* $NetBSD: ohci.c,v 1.27 1999/01/13 10:33:53 augustss Exp $ */
|
||||
/* $FreeBSD$ */
|
||||
|
||||
/*
|
||||
@ -565,7 +565,7 @@ ohci_intr(p)
|
||||
void *p;
|
||||
{
|
||||
ohci_softc_t *sc = p;
|
||||
u_int32_t intrs = 0, eintrs;
|
||||
u_int32_t intrs, eintrs;
|
||||
ohci_physaddr_t done;
|
||||
|
||||
/* In case the interrupt occurs before initialization has completed. */
|
||||
@ -576,6 +576,7 @@ ohci_intr(p)
|
||||
return (0);
|
||||
}
|
||||
|
||||
intrs = 0;
|
||||
done = LE(sc->sc_hcca->hcca_done_head);
|
||||
if (done != 0) {
|
||||
sc->sc_hcca->hcca_done_head = 0;
|
||||
@ -672,7 +673,7 @@ ohci_process_done(sc, done)
|
||||
ohci_softc_t *sc;
|
||||
ohci_physaddr_t done;
|
||||
{
|
||||
ohci_soft_td_t *std = NULL, *sdone;
|
||||
ohci_soft_td_t *std, *sdone;
|
||||
usbd_request_handle reqh;
|
||||
int len, cc;
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* $NetBSD: ohcireg.h,v 1.7 1998/12/10 23:16:47 augustss Exp $ */
|
||||
/* FreeBSD $Id$ */
|
||||
/* $FreeBSD$ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1998 The NetBSD Foundation, Inc.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* $NetBSD: ohcivar.h,v 1.4 1998/12/26 12:53:01 augustss Exp $ */
|
||||
/* FreeBSD $Id$ */
|
||||
/* $FreeBSD$ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1998 The NetBSD Foundation, Inc.
|
||||
|
@ -45,8 +45,8 @@
|
||||
#include <sys/kernel.h>
|
||||
#include <sys/malloc.h>
|
||||
#if defined(__NetBSD__)
|
||||
#include <sys/device.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/device.h>
|
||||
#elif defined(__FreeBSD__)
|
||||
#include <sys/module.h>
|
||||
#include <sys/bus.h>
|
||||
@ -126,6 +126,7 @@ ucom_detach(device_t self)
|
||||
{
|
||||
char *devinfo = (char *) device_get_desc(self);
|
||||
|
||||
DPRINTF(("%s: disconnected\n", USBDEVNAME(self)));
|
||||
if (devinfo) {
|
||||
device_set_desc(self, NULL);
|
||||
free(devinfo, M_USB);
|
||||
|
@ -937,8 +937,6 @@ uhci_run(sc, run)
|
||||
|
||||
s = splusb();
|
||||
running = ((UREAD2(sc, UHCI_STS) & UHCI_STS_HCH) == 0);
|
||||
DPRINTF(("sc->sc_iobase=0x%x run=0x%x, running=0x%x\n",
|
||||
sc->sc_iobase, run,running));
|
||||
if (run == running) {
|
||||
splx(s);
|
||||
return (USBD_NORMAL_COMPLETION);
|
||||
@ -946,7 +944,6 @@ uhci_run(sc, run)
|
||||
UWRITE2(sc, UHCI_CMD, run ? UHCI_CMD_RS : 0);
|
||||
for(n = 0; n < 10; n++) {
|
||||
running = ((UREAD2(sc, UHCI_STS) & UHCI_STS_HCH) == 0);
|
||||
DPRINTF(("run=0x%x, running=0x%x\n", run,running));
|
||||
/* return when we've entered the state we want */
|
||||
if (run == running) {
|
||||
splx(s);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* $NetBSD: uhcireg.h,v 1.5 1998/12/27 23:40:52 augustss Exp $ */
|
||||
/* FreeBSD $Id$ */
|
||||
/* $FreeBSD$ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1998 The NetBSD Foundation, Inc.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* $NetBSD: uhcivar.h,v 1.5 1998/12/26 12:53:02 augustss Exp $ */
|
||||
/* FreeBSD $Id$ */
|
||||
/* $FreeBSD$ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1998 The NetBSD Foundation, Inc.
|
||||
|
@ -202,6 +202,7 @@ uhid_detach(device_t self)
|
||||
{
|
||||
char *devinfo = (char *) device_get_desc(self);
|
||||
|
||||
DPRINTF(("%s: disconnected\n", USBDEVNAME(self)));
|
||||
if (devinfo) {
|
||||
device_set_desc(self, NULL);
|
||||
free(devinfo, M_USB);
|
||||
|
@ -75,11 +75,11 @@ struct uhub_softc {
|
||||
};
|
||||
|
||||
usbd_status uhub_init_port __P((struct usbd_port *));
|
||||
void uhub_disconnect __P((struct usbd_port *up));
|
||||
void uhub_disconnect_port __P((struct usbd_port *up));
|
||||
usbd_status uhub_explore __P((usbd_device_handle hub));
|
||||
void uhub_intr __P((usbd_request_handle, usbd_private_handle, usbd_status));
|
||||
|
||||
/*void uhub_disco __P((void *));*/
|
||||
/* void uhub_disco __P((void *)); */
|
||||
|
||||
USB_DECLARE_DRIVER(uhub);
|
||||
|
||||
@ -252,13 +252,17 @@ static int
|
||||
uhub_detach(device_t self)
|
||||
{
|
||||
struct uhub_softc *sc = device_get_softc(self);
|
||||
int nports = sc->sc_hub->hub->hubdesc.bNbrPorts;
|
||||
struct usbd_port *up;
|
||||
usbd_device_handle dev = sc->sc_hub;
|
||||
int nports;
|
||||
int p;
|
||||
|
||||
DPRINTF(("%s: disconnected\n", USBDEVNAME(self)));
|
||||
nports = dev->hub->hubdesc.bNbrPorts;
|
||||
for (p = 0; p < nports; p++) {
|
||||
struct usbd_port *up = &sc->sc_hub->hub->ports[p];
|
||||
up = &sc->sc_hub->hub->ports[p];
|
||||
if (up->device)
|
||||
uhub_disconnect(up);
|
||||
uhub_disconnect_port(up);
|
||||
}
|
||||
|
||||
free(sc->sc_hub->hub, M_USB);
|
||||
@ -387,7 +391,7 @@ uhub_explore(dev)
|
||||
DPRINTF(("uhub_explore: device %d disappeared "
|
||||
"on port %d\n",
|
||||
up->device->address, port));
|
||||
uhub_disconnect(up);
|
||||
uhub_disconnect_port(up);
|
||||
usbd_clear_port_feature(dev, port,
|
||||
UHF_C_PORT_CONNECTION);
|
||||
}
|
||||
@ -424,7 +428,7 @@ uhub_explore(dev)
|
||||
if (r == USBD_SET_ADDR_FAILED || 1) {/* XXX */
|
||||
/* The unit refused to accept a new
|
||||
* address, and since we cannot leave
|
||||
* at 0 we have to disable the port
|
||||
* it at 0 we have to disable the port
|
||||
* instead. */
|
||||
printf("%s: device problem, disabling "
|
||||
"port %d\n",
|
||||
@ -443,20 +447,24 @@ uhub_explore(dev)
|
||||
}
|
||||
|
||||
void
|
||||
uhub_disconnect(up)
|
||||
uhub_disconnect_port(up)
|
||||
struct usbd_port *up;
|
||||
{
|
||||
usbd_device_handle dev = up->device;
|
||||
usbd_pipe_handle p, n;
|
||||
int i;
|
||||
struct softc { bdevice sc_dev; }; /* all softc begin like this */
|
||||
struct softc { /* all softc begin like this */
|
||||
bdevice sc_dev;
|
||||
};
|
||||
|
||||
DPRINTFN(3,("uhub_disconnect: up=%p dev=%p port=%d\n",
|
||||
struct softc *sc = (struct softc *)dev->softc;
|
||||
struct softc *scp = (struct softc *)up->parent->softc;
|
||||
|
||||
DPRINTFN(3,("uhub_disconnect_port: up=%p dev=%p port=%d\n",
|
||||
up, dev, up->portno));
|
||||
|
||||
printf("%s: at %s port %d (addr %d) disconnected\n",
|
||||
USBDEVNAME(((struct softc *)dev->softc)->sc_dev),
|
||||
USBDEVNAME(((struct uhub_softc *)up->parent->softc)->sc_dev),
|
||||
USBDEVNAME(sc->sc_dev), USBDEVNAME(scp->sc_dev),
|
||||
up->portno, dev->address);
|
||||
|
||||
if (!dev->cdesc) {
|
||||
@ -466,13 +474,13 @@ uhub_disconnect(up)
|
||||
return;
|
||||
}
|
||||
|
||||
/* Remove the device */
|
||||
#if defined(__NetBSD__)
|
||||
for (i = 0; i < dev->cdesc->bNumInterface; i++) {
|
||||
for (p = LIST_FIRST(&dev->ifaces[i].pipes); p; p = n) {
|
||||
n = LIST_NEXT(p, next);
|
||||
if (p->disco)
|
||||
p->disco(p->discoarg);
|
||||
usbd_abort_pipe(p);
|
||||
usbd_close_pipe(p);
|
||||
}
|
||||
}
|
||||
|
||||
@ -486,18 +494,25 @@ uhub_disconnect(up)
|
||||
for(p = 0; p < nports; p++) {
|
||||
rup = &dev->hub->ports[p];
|
||||
if (rup->device)
|
||||
uhub_disconnect(rup);
|
||||
uhub_disconnect_port(rup);
|
||||
}
|
||||
}
|
||||
#elif defined(__FreeBSD__)
|
||||
device_delete_child(scp->sc_dev, sc->sc_dev);
|
||||
#endif
|
||||
|
||||
/* clean up the kitchen */
|
||||
for (i = 0; i < dev->cdesc->bNumInterface; i++) {
|
||||
for (p = LIST_FIRST(&dev->ifaces[i].pipes); p; p = n) {
|
||||
n = LIST_NEXT(p, next);
|
||||
usbd_abort_pipe(p);
|
||||
usbd_close_pipe(p);
|
||||
}
|
||||
}
|
||||
|
||||
dev->bus->devices[dev->address] = 0;
|
||||
up->device = 0;
|
||||
/* XXX free */
|
||||
#if defined(__FreeBSD__)
|
||||
device_delete_child(
|
||||
device_get_parent(((struct softc *)dev->softc)->sc_dev),
|
||||
((struct softc *)dev->softc)->sc_dev);
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -364,6 +364,7 @@ ukbd_detach(device_t self)
|
||||
struct ukbd_softc *sc = device_get_softc(self);
|
||||
char *devinfo = (char *) device_get_desc(self);
|
||||
|
||||
DPRINTF(("%s: disconnected\n", USBDEVNAME(self)));
|
||||
if (sc->sc_enabled)
|
||||
return (ENXIO);
|
||||
|
||||
|
@ -439,6 +439,7 @@ ulpt_detach(device_t self)
|
||||
{
|
||||
char *devinfo = (char *) device_get_desc(self);
|
||||
|
||||
DPRINTF(("%s: disconnected\n", USBDEVNAME(self)));
|
||||
if (devinfo) {
|
||||
device_set_desc(self, NULL);
|
||||
free(devinfo, M_USB);
|
||||
|
@ -127,6 +127,7 @@ umodem_detach(device_t self)
|
||||
{
|
||||
char *devinfo = (char *) device_get_desc(self);
|
||||
|
||||
DPRINTF(("%s: disconnected\n", USBDEVNAME(self)));
|
||||
if (devinfo) {
|
||||
device_set_desc(self, NULL);
|
||||
free(devinfo, M_USB);
|
||||
|
@ -404,14 +404,9 @@ usb_needs_explore(bus)
|
||||
int
|
||||
usb_detach(device_t self)
|
||||
{
|
||||
char *devinfo = (char *) device_get_desc(self);
|
||||
DPRINTF(("%s: disconnected\n", USBDEVNAME(self)));
|
||||
|
||||
if (devinfo) {
|
||||
device_set_desc(self, NULL);
|
||||
free(devinfo, M_USB);
|
||||
}
|
||||
|
||||
return (0);
|
||||
return (1);
|
||||
}
|
||||
|
||||
DRIVER_MODULE(usb, root, usb_driver, usb_devclass, 0, 0);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* $NetBSD: usb.h,v 1.17 1999/01/03 01:09:18 augustss Exp $ */
|
||||
/* FreeBSD $Id: usb.h,v 1.6 1999/01/07 23:31:37 n_hibma Exp $ */
|
||||
/* $FreeBSD$ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1998 The NetBSD Foundation, Inc.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* $NetBSD: usb_mem.h,v 1.4 1999/01/09 12:16:54 augustss Exp $ */
|
||||
/* FreeBSD $Id: usb_mem.h,v 1.4 1999/01/07 23:31:38 n_hibma Exp $ */
|
||||
/* $FreeBSD$ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1998 The NetBSD Foundation, Inc.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* $NetBSD: usb_quirks.c,v 1.8 1999/01/08 11:58:25 augustss Exp $ */
|
||||
/* FreeBSD $Id: usb_quirks.c,v 1.5 1999/01/07 23:31:39 n_hibma Exp $ */
|
||||
/* $FreeBSD$ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1998 The NetBSD Foundation, Inc.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* $NetBSD: usb_quirks.h,v 1.5 1998/12/29 15:23:59 augustss Exp $ */
|
||||
/* FreeBSD $Id$ */
|
||||
/* $FreeBSD$ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1998 The NetBSD Foundation, Inc.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* $NetBSD: usb_subr.c,v 1.27 1999/01/08 11:58:25 augustss Exp $ */
|
||||
/* FreeBSD $Id: usb_subr.c,v 1.6 1999/01/07 23:31:40 n_hibma Exp $ */
|
||||
/* $FreeBSD$ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1998 The NetBSD Foundation, Inc.
|
||||
@ -725,7 +725,10 @@ usbd_probe_and_attach(parent, dev, port, addr)
|
||||
{
|
||||
struct usb_attach_arg uaa;
|
||||
usb_device_descriptor_t *dd = &dev->ddesc;
|
||||
int r, found, i, confi, nifaces;
|
||||
#if defined(__NetBSD__)
|
||||
int found = 0;
|
||||
#endif
|
||||
int r, i, confi, nifaces;
|
||||
usbd_interface_handle ifaces[256]; /* 256 is the absolute max */
|
||||
|
||||
#if defined(__FreeBSD__)
|
||||
@ -780,19 +783,25 @@ usbd_probe_and_attach(parent, dev, port, addr)
|
||||
ifaces[i] = &dev->ifaces[i];
|
||||
uaa.ifaces = ifaces;
|
||||
uaa.nifaces = nifaces;
|
||||
for (found = i = 0; i < nifaces; i++) {
|
||||
for (i = 0; i < nifaces; i++) {
|
||||
if (!ifaces[i])
|
||||
continue; /* interface already claimed */
|
||||
uaa.iface = ifaces[i];
|
||||
uaa.ifaceno = ifaces[i]->idesc->bInterfaceNumber;
|
||||
if (USB_DO_ATTACH(dev, bdev, parent, &uaa, usbd_print,
|
||||
usbd_submatch)) {
|
||||
#if defined(__NetBSD__)
|
||||
found++;
|
||||
ifaces[i] = 0; /* consumed */
|
||||
#elif defined(__FreeBSD__)
|
||||
return (USBD_NORMAL_COMPLETION);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
#if defined(__NetBSD__)
|
||||
if (found != 0)
|
||||
return (USBD_NORMAL_COMPLETION);
|
||||
#endif
|
||||
}
|
||||
/* No interfaces were attached in any of the configurations. */
|
||||
if (dd->bNumConfigurations > 1)/* don't change if only 1 config */
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* $NetBSD: usbcdc.h,v 1.3 1999/01/03 01:09:18 augustss Exp $ */
|
||||
/* FreeBSD $Id$ */
|
||||
/* $FreeBSD$ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1998 The NetBSD Foundation, Inc.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* $NetBSD: usbdi.c,v 1.20 1999/01/08 11:58:26 augustss Exp $ */
|
||||
/* FreeBSD $Id: usbdi.c,v 1.7 1999/01/07 23:31:42 n_hibma Exp $ */
|
||||
/* $FreeBSD$ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1998 The NetBSD Foundation, Inc.
|
||||
@ -418,14 +418,14 @@ usbd_abort_pipe(pipe)
|
||||
usbd_pipe_handle pipe;
|
||||
{
|
||||
usbd_status r;
|
||||
int s, st;
|
||||
int s, state;
|
||||
|
||||
if (pipe->iface->state != USBD_INTERFACE_ACTIVE)
|
||||
return (USBD_INTERFACE_NOT_ACTIVE);
|
||||
s = splusb();
|
||||
st = pipe->state;
|
||||
state = pipe->state;
|
||||
r = usbd_ar_pipe(pipe);
|
||||
pipe->state = st;
|
||||
pipe->state = state;
|
||||
splx(s);
|
||||
return (r);
|
||||
}
|
||||
@ -664,9 +664,7 @@ usbd_bus_count()
|
||||
{
|
||||
return (usb_bus_count());
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(__NetBSD__)
|
||||
usbd_status
|
||||
usbd_get_bus_handle(index, bus)
|
||||
u_int8_t index;
|
||||
@ -1251,7 +1249,7 @@ usbd_driver_load(module_t mod, int what, void *arg)
|
||||
if (error)
|
||||
return 0; /* XXX maybe transient, or error? */
|
||||
|
||||
for (devcount--; devcount >= 0; devcount--)
|
||||
for (; devcount; devcount--)
|
||||
USB_RECONFIGURE(devlist[devcount]);
|
||||
|
||||
free(devlist, M_TEMP);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* $NetBSD: usbdi.h,v 1.16 1999/01/08 11:58:26 augustss Exp $ */
|
||||
/* FreeBSD $Id: usbdi.h,v 1.4 1999/01/07 23:31:43 n_hibma Exp $ */
|
||||
/* $FreeBSD$ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1998 The NetBSD Foundation, Inc.
|
||||
@ -177,8 +177,8 @@ usbd_status usbd_interface_count
|
||||
__P((usbd_device_handle dev, u_int8_t *count));
|
||||
#if 0
|
||||
u_int8_t usbd_bus_count __P((void));
|
||||
#endif
|
||||
usbd_status usbd_get_bus_handle __P((u_int8_t index, usbd_bus_handle *bus));
|
||||
#endif
|
||||
usbd_status usbd_get_root_hub
|
||||
__P((usbd_bus_handle bus, usbd_device_handle *dev));
|
||||
usbd_status usbd_port_count __P((usbd_device_handle hub, u_int8_t *nports));
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* $NetBSD: usbdi_util.c,v 1.13 1999/01/08 11:58:26 augustss Exp $ */
|
||||
/* FreeBSD $Id: usbdi_util.c,v 1.5 1999/01/07 23:31:43 n_hibma Exp $ */
|
||||
/* $FreeBSD$ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1998 The NetBSD Foundation, Inc.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* $NetBSD: usbdi_util.h,v 1.12 1999/01/01 15:25:57 augustss Exp $ */
|
||||
/* FreeBSD $Id$ */
|
||||
/* $FreeBSD$ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1998 The NetBSD Foundation, Inc.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* $NetBSD: usbdivar.h,v 1.16 1999/01/08 11:58:26 augustss Exp $ */
|
||||
/* FreeBSD $Id: usbdivar.h,v 1.6 1999/01/07 23:31:45 n_hibma Exp $ */
|
||||
/* $FreeBSD$ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1998 The NetBSD Foundation, Inc.
|
||||
@ -200,8 +200,10 @@ usbd_status usbd_fill_iface_data __P((usbd_device_handle dev,
|
||||
|
||||
/* Routines from usb.c */
|
||||
int usb_bus_count __P((void));
|
||||
usbd_status usb_get_bus_handle __P((int, usbd_bus_handle *));
|
||||
void usb_needs_explore __P((usbd_bus_handle));
|
||||
#if 0
|
||||
usbd_status usb_get_bus_handle __P((int, usbd_bus_handle *));
|
||||
#endif
|
||||
|
||||
/* Locator stuff. */
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* $NetBSD: usbhid.h,v 1.3 1998/12/26 12:53:04 augustss Exp $ */
|
||||
/* FreeBSD $Id$ */
|
||||
/* $FreeBSD$ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1998 The NetBSD Foundation, Inc.
|
||||
|
Loading…
x
Reference in New Issue
Block a user