diff options
| author | 2010-04-21 21:16:43 +0000 | |
|---|---|---|
| committer | 2010-04-21 21:16:43 +0000 | |
| commit | fb804160be2ec6a0a7d99eb4257d1e6f56416ccd (patch) | |
| tree | 14b335329a31d56835a72fa6f1f6a9c3fc18555d /sys/dev/pci/pci.c | |
| parent | sys/sysctl.h is not needed here. OK deraadt@ (diff) | |
| download | wireguard-openbsd-fb804160be2ec6a0a7d99eb4257d1e6f56416ccd.tar.xz wireguard-openbsd-fb804160be2ec6a0a7d99eb4257d1e6f56416ccd.zip | |
Directly comparing pcitag_t's doesn't work on all platforms so decompose the
tag and compare the individual components.
Diffstat (limited to 'sys/dev/pci/pci.c')
| -rw-r--r-- | sys/dev/pci/pci.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/sys/dev/pci/pci.c b/sys/dev/pci/pci.c index c0abc728ba3..70e06b13fdb 100644 --- a/sys/dev/pci/pci.c +++ b/sys/dev/pci/pci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pci.c,v 1.74 2010/04/21 18:55:40 kettenis Exp $ */ +/* $OpenBSD: pci.c,v 1.75 2010/04/21 21:16:43 kettenis Exp $ */ /* $NetBSD: pci.c,v 1.31 1997/06/06 23:48:04 thorpej Exp $ */ /* @@ -988,6 +988,7 @@ pciioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p) case PCIOCSETVGA: { struct pci_vga *vga = (struct pci_vga *)data; + int bus, device, function; switch (vga->pv_lock) { case PCI_VGA_UNLOCK: @@ -1016,7 +1017,11 @@ pciioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p) } pci_vga_proc = p; - if (tag != pci_vga_tag) { + pci_decompose_tag(pci_vga_pci->sc_pc, pci_vga_tag, + &bus, &device, &function); + if (bus != vga->pv_sel.pc_bus || + device != vga->pv_sel.pc_dev || + function != vga->pv_sel.pc_func) { pci_disable_vga(pci_vga_pci->sc_pc, pci_vga_tag); if (pci != pci_vga_pci) { pci_unroute_vga(pci_vga_pci); |
