Fix the 'usb0: USB revision unknown, not supported' people have been seeing

by identifying the version in the PCI drivers.

The OHCI driver just presets this to 1.0 as it is not specified in the
PCI registers anywhere. This should be revisited once USB 2.0 is in
wide spread use.
This commit is contained in:
Nick Hibma 1999-12-03 01:34:42 +00:00
parent 43cd4e8815
commit b47337d347
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=54050
5 changed files with 26 additions and 32 deletions

View File

@ -146,6 +146,9 @@ ohci_pci_attach(device_t self)
void *ih;
int intr;
/* XXX where does it say so in the spec? */
sc->sc_bus.usbrev = USBREV_1_0;
rid = PCI_CBMEM;
res = bus_alloc_resource(self, SYS_RES_MEMORY, &rid,
0, ~0, 1, RF_ACTIVE);

View File

@ -155,7 +155,6 @@ uhci_pci_attach(device_t self)
void *ih;
struct resource *res;
device_t usbus;
char *typestr;
int intr;
int legsup;
int err;
@ -208,21 +207,17 @@ uhci_pci_attach(device_t self)
sprintf(sc->sc_vendor, "(0x%08x)", pci_get_devid(self));
}
if (bootverbose) {
switch(pci_read_config(self, PCI_USBREV, 4) & PCI_USBREV_MASK) {
case PCI_USBREV_PRE_1_0:
typestr = "pre 1.0";
sc->sc_bus.usbrev = USBREV_PRE_1_0;
break;
case PCI_USBREV_1_0:
typestr = "1.0";
sc->sc_bus.usbrev = USBREV_1_0;
break;
default:
typestr = "unknown";
sc->sc_bus.usbrev = USBREV_UNKNOWN;
break;
}
device_printf(self, "USB version %s, chip rev. %d\n",
typestr, pci_get_revid(self));
}
intr = pci_read_config(self, PCIR_INTLINE, 1);
if (intr == 0 || intr == 255) {

View File

@ -211,9 +211,7 @@ USB_ATTACH(usb)
printf(": USB revision %s", usbrev_str[usbrev]);
if (usbrev != USBREV_1_0 && usbrev != USBREV_1_1) {
printf(", not supported\n");
#if BROKEN
USB_ATTACH_ERROR_RETURN;
#endif
}
printf("\n");

View File

@ -146,6 +146,9 @@ ohci_pci_attach(device_t self)
void *ih;
int intr;
/* XXX where does it say so in the spec? */
sc->sc_bus.usbrev = USBREV_1_0;
rid = PCI_CBMEM;
res = bus_alloc_resource(self, SYS_RES_MEMORY, &rid,
0, ~0, 1, RF_ACTIVE);

View File

@ -155,7 +155,6 @@ uhci_pci_attach(device_t self)
void *ih;
struct resource *res;
device_t usbus;
char *typestr;
int intr;
int legsup;
int err;
@ -208,21 +207,17 @@ uhci_pci_attach(device_t self)
sprintf(sc->sc_vendor, "(0x%08x)", pci_get_devid(self));
}
if (bootverbose) {
switch(pci_read_config(self, PCI_USBREV, 4) & PCI_USBREV_MASK) {
case PCI_USBREV_PRE_1_0:
typestr = "pre 1.0";
sc->sc_bus.usbrev = USBREV_PRE_1_0;
break;
case PCI_USBREV_1_0:
typestr = "1.0";
sc->sc_bus.usbrev = USBREV_1_0;
break;
default:
typestr = "unknown";
sc->sc_bus.usbrev = USBREV_UNKNOWN;
break;
}
device_printf(self, "USB version %s, chip rev. %d\n",
typestr, pci_get_revid(self));
}
intr = pci_read_config(self, PCIR_INTLINE, 1);
if (intr == 0 || intr == 255) {