summaryrefslogtreecommitdiffstats
path: root/sys/dev/pci
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/pci')
-rw-r--r--sys/dev/pci/pci.c26
-rw-r--r--sys/dev/pci/pcireg.h1
2 files changed, 2 insertions, 25 deletions
diff --git a/sys/dev/pci/pci.c b/sys/dev/pci/pci.c
index 0b7b267..47aedbd 100644
--- a/sys/dev/pci/pci.c
+++ b/sys/dev/pci/pci.c
@@ -2149,62 +2149,38 @@ pci_disable_busmaster_method(device_t dev, device_t child)
int
pci_enable_io_method(device_t dev, device_t child, int space)
{
- uint16_t command;
uint16_t bit;
- char *error;
-
- bit = 0;
- error = NULL;
switch(space) {
case SYS_RES_IOPORT:
bit = PCIM_CMD_PORTEN;
- error = "port";
break;
case SYS_RES_MEMORY:
bit = PCIM_CMD_MEMEN;
- error = "memory";
break;
default:
return (EINVAL);
}
pci_set_command_bit(dev, child, bit);
- /* Some devices seem to need a brief stall here, what do to? */
- command = PCI_READ_CONFIG(dev, child, PCIR_COMMAND, 2);
- if (command & bit)
- return (0);
- device_printf(child, "failed to enable %s mapping!\n", error);
- return (ENXIO);
+ return (0);
}
int
pci_disable_io_method(device_t dev, device_t child, int space)
{
- uint16_t command;
uint16_t bit;
- char *error;
-
- bit = 0;
- error = NULL;
switch(space) {
case SYS_RES_IOPORT:
bit = PCIM_CMD_PORTEN;
- error = "port";
break;
case SYS_RES_MEMORY:
bit = PCIM_CMD_MEMEN;
- error = "memory";
break;
default:
return (EINVAL);
}
pci_clear_command_bit(dev, child, bit);
- command = PCI_READ_CONFIG(dev, child, PCIR_COMMAND, 2);
- if (command & bit) {
- device_printf(child, "failed to disable %s mapping!\n", error);
- return (ENXIO);
- }
return (0);
}
diff --git a/sys/dev/pci/pcireg.h b/sys/dev/pci/pcireg.h
index c7a7245..981d1e0 100644
--- a/sys/dev/pci/pcireg.h
+++ b/sys/dev/pci/pcireg.h
@@ -44,6 +44,7 @@
#define PCI_SLOTMAX 31 /* highest supported slot number */
#define PCI_FUNCMAX 7 /* highest supported function number */
#define PCI_REGMAX 255 /* highest supported config register addr. */
+#define PCIE_REGMAX 4095 /* highest supported config register addr. */
#define PCI_MAXHDRTYPE 2
/* PCI config header registers for all devices */
OpenPOWER on IntegriCloud