aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/pci
diff options
context:
space:
mode:
authorJulian Elischer <julian@FreeBSD.org>1998-12-10 22:07:05 +0000
committerJulian Elischer <julian@FreeBSD.org>1998-12-10 22:07:05 +0000
commit3265f363c60eade84e3cf013a434818f5e31fb64 (patch)
tree2ca1ce941592cd6023da5cb40d1f50f15a26f15f /sys/dev/pci
parentb6776b7488913910a664b20fff67b402664eb4ad (diff)
downloadsrc-3265f363c60eade84e3cf013a434818f5e31fb64.tar.gz
src-3265f363c60eade84e3cf013a434818f5e31fb64.zip
The shift and the masking were in the wrong order for extracting
the INTERFACE type byte from the longword register.
Notes
Notes: svn path=/head/; revision=41662
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 656c6ddec13d..e1d973ba920c 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);
}