summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authormarcel <marcel@FreeBSD.org>2003-02-23 23:09:17 +0000
committermarcel <marcel@FreeBSD.org>2003-02-23 23:09:17 +0000
commit0ae2956720d45dbfd2c67acdf907e1fbf9301983 (patch)
treec81c3d3125cacd45dc3268c0212ebed67eaea89a /sys
parent2072a48a930c2b549b7493b3354db648823352c5 (diff)
downloadFreeBSD-src-0ae2956720d45dbfd2c67acdf907e1fbf9301983.zip
FreeBSD-src-0ae2956720d45dbfd2c67acdf907e1fbf9301983.tar.gz
Use the correct size for reading and writing the PCI config space.
Reading the PCI config space with the wrong (larger) size is not a problem in this case, but writing can be as it clobbers unrelated registers. In this case the clobbering is for reserved fields, which too is mostly harmless... for now. Hence, this change is mostly preventive in nature.
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/usb/uhci_pci.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/dev/usb/uhci_pci.c b/sys/dev/usb/uhci_pci.c
index e77db61..5c37051 100644
--- a/sys/dev/usb/uhci_pci.c
+++ b/sys/dev/usb/uhci_pci.c
@@ -271,7 +271,7 @@ uhci_pci_attach(device_t self)
sprintf(sc->sc_vendor, "(0x%04x)", pci_get_vendor(self));
}
- switch (pci_read_config(self, PCI_USBREV, 4) & PCI_USBREV_MASK) {
+ switch (pci_read_config(self, PCI_USBREV, 1) & PCI_USBREV_MASK) {
case PCI_USBREV_PRE_1_0:
sc->sc_bus.usbrev = USBREV_PRE_1_0;
break;
@@ -298,11 +298,11 @@ uhci_pci_attach(device_t self)
* to the ports of the root hub?
*/
#ifdef USB_DEBUG
- if (pci_read_config(self, PCI_LEGSUP, 4) != PCI_LEGSUP_USBPIRQDEN)
- device_printf(self, "LegSup = 0x%08x\n",
- pci_read_config(self, PCI_LEGSUP, 4));
+ if (pci_read_config(self, PCI_LEGSUP, 2) != PCI_LEGSUP_USBPIRQDEN)
+ device_printf(self, "LegSup = 0x%04x\n",
+ pci_read_config(self, PCI_LEGSUP, 2));
#endif
- pci_write_config(self, PCI_LEGSUP, PCI_LEGSUP_USBPIRQDEN, 4);
+ pci_write_config(self, PCI_LEGSUP, PCI_LEGSUP_USBPIRQDEN, 2);
err = uhci_init(sc);
if (!err)
OpenPOWER on IntegriCloud