summaryrefslogtreecommitdiff
path: root/usr/src
diff options
context:
space:
mode:
authormyers <none@none>2005-08-16 12:10:33 -0700
committermyers <none@none>2005-08-16 12:10:33 -0700
commitc11e1991fc8d2ce1cfef4bd73a7522af330509a3 (patch)
tree7621966d4e3b0550433a60f16fb2b5cfa36e87b1 /usr/src
parent18fdaaef96cf74126ff84be8aa0b50a701a3f374 (diff)
downloadillumos-gate-c11e1991fc8d2ce1cfef4bd73a7522af330509a3.tar.gz
6265037 pci: Compaq Presario R3000 has usb mouse problems with nv14
Diffstat (limited to 'usr/src')
-rw-r--r--usr/src/uts/i86pc/io/pci/pci.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/usr/src/uts/i86pc/io/pci/pci.c b/usr/src/uts/i86pc/io/pci/pci.c
index 214362fb4d..9fe5d3a8b6 100644
--- a/usr/src/uts/i86pc/io/pci/pci.c
+++ b/usr/src/uts/i86pc/io/pci/pci.c
@@ -164,6 +164,14 @@ struct dev_ops pci_ops = {
};
/*
+ * This variable controls the default setting of the command register
+ * for pci devices. See pci_initchild() for details.
+ */
+static ushort_t pci_command_default = PCI_COMM_ME |
+ PCI_COMM_MAE |
+ PCI_COMM_IO;
+
+/*
* Internal routines in support of particular pci_ctlops.
*/
static int pci_removechild(dev_info_t *child);
@@ -1226,6 +1234,8 @@ pci_initchild(dev_info_t *child)
{
struct ddi_parent_private_data *pdptr;
char name[80];
+ ddi_acc_handle_t config_handle;
+ ushort_t command_preserve, command;
if (pci_name_child(child, name, 80) != DDI_SUCCESS) {
return (DDI_FAILURE);
@@ -1301,6 +1311,24 @@ pci_initchild(dev_info_t *child)
} else
ddi_set_parent_data(child, NULL);
+ /*
+ * initialize command register
+ */
+ if (pci_config_setup(child, &config_handle) != DDI_SUCCESS)
+ return (DDI_FAILURE);
+
+ /*
+ * Support for the "command-preserve" property.
+ */
+ command_preserve = ddi_prop_get_int(DDI_DEV_T_ANY, child,
+ DDI_PROP_DONTPASS,
+ "command-preserve", 0);
+ command = pci_config_get16(config_handle, PCI_CONF_COMM);
+ command &= (command_preserve | PCI_COMM_BACK2BACK_ENAB);
+ command |= (pci_command_default & ~command_preserve);
+ pci_config_put16(config_handle, PCI_CONF_COMM, command);
+
+ pci_config_teardown(&config_handle);
return (DDI_SUCCESS);
}