summaryrefslogtreecommitdiffstats
path: root/sys/dev/pci
diff options
context:
space:
mode:
authorjulian <julian@FreeBSD.org>1998-12-10 22:07:05 +0000
committerjulian <julian@FreeBSD.org>1998-12-10 22:07:05 +0000
commitab7355e57bc1e77b8c2f1af52ab8b75f8049ec9f (patch)
treee8b963fb01d75271c74047d219e317bb1501e51b /sys/dev/pci
parentfd263f3ca287ebc942d313d4df6bf169ad046c11 (diff)
downloadFreeBSD-src-ab7355e57bc1e77b8c2f1af52ab8b75f8049ec9f.zip
FreeBSD-src-ab7355e57bc1e77b8c2f1af52ab8b75f8049ec9f.tar.gz
The shift and the masking were in the wrong order for extracting
the INTERFACE type byte from the longword register.
Diffstat (limited to 'sys/dev/pci')
-rw-r--r--sys/dev/pci/ohci_pci.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/sys/dev/pci/ohci_pci.c b/sys/dev/pci/ohci_pci.c
index 656c6dd..e1d973b 100644
--- a/sys/dev/pci/ohci_pci.c
+++ b/sys/dev/pci/ohci_pci.c
@@ -92,12 +92,12 @@ struct cfattach ohci_pci_ca = {
#define PCI_INTERFACE_MASK 0x0000ff00
#define PCI_INTERFACE_SHIFT 8
-#define PCI_INTERFACE(d) (((d)>>8)&PCI_INTERFACE_MASK)
-#define PCI_SUBCLASS(d) ((d)&PCI_SUBCLASS_MASK)
-#define PCI_CLASS(d) ((d)&PCI_CLASS_MASK)
+#define PCI_INTERFACE(d) (((d) >> 8) & 0xff)
+#define PCI_SUBCLASS(d) ((d) & PCI_SUBCLASS_MASK)
+#define PCI_CLASS(d) ((d) & PCI_CLASS_MASK)
-#define PCI_VENDOR(d) ((d)&0xffff)
-#define PCI_DEVICE(d) (((d)>>8)&0xffff)
+#define PCI_VENDOR(d) ((d) & 0xffff)
+#define PCI_DEVICE(d) (((d) >> 8) & 0xffff)
#define PCI_OHCI_BASE_REG 0x10
@@ -140,9 +140,9 @@ ohci_pci_probe(pcici_t config_id, pcidi_t device_id)
u_int32_t class;
class = pci_conf_read(config_id, PCI_CLASS_REG);
- if ( PCI_CLASS(class) == PCI_CLASS_SERIALBUS
- && PCI_SUBCLASS(class) == PCI_SUBCLASS_SERIALBUS_USB
- && PCI_INTERFACE(class) == PCI_INTERFACE_OHCI)
+ if ( (PCI_CLASS(class) == PCI_CLASS_SERIALBUS)
+ && (PCI_SUBCLASS(class) == PCI_SUBCLASS_SERIALBUS_USB)
+ && (PCI_INTERFACE(class) == PCI_INTERFACE_OHCI))
return("OHCI Host Controller");
return NULL; /* dunno */
@@ -251,7 +251,7 @@ ohci_pci_attach(pcici_t config_id, int unit)
{
printf("usb%d: OHCI version %d%d, interrupting at %d\n", unit,
/* XXX is this correct? Does the correct version show up? */
- (rev&0xf0)>>8, rev&0x0f,
+ (rev & 0xf0) >> 8, rev & 0x0f,
(int)pci_conf_read(config_id,PCI_INTERRUPT_REG) & 0xff);
}
OpenPOWER on IntegriCloud