-/* $OpenBSD: bonito.c,v 1.14 2010/05/08 21:59:56 miod Exp $ */
+/* $OpenBSD: bonito.c,v 1.15 2010/07/18 13:36:13 miod Exp $ */
/* $NetBSD: bonito_mainbus.c,v 1.11 2008/04/28 20:23:10 martin Exp $ */
/* $NetBSD: bonito_pci.c,v 1.5 2008/04/28 20:23:28 martin Exp $ */
bus_space_handle_t *bshp)
{
const struct legacy_io_range *r;
+ bus_addr_t rend;
if (offs < BONITO_PCIIO_LEGACY) {
- size--;
- for (r = sys_platform->legacy_io_ranges; r->start != 0; r++)
- if (offs >= r->start && offs + size <= r->end)
+ if ((r = sys_platform->legacy_io_ranges) == NULL)
+ return ENXIO;
+
+ rend = offs + size - 1;
+ for (; r->start != 0; r++)
+ if (offs >= r->start && rend <= r->end)
break;
if (r->end == 0)
-/* $OpenBSD: wscons_machdep.c,v 1.7 2010/05/08 21:59:56 miod Exp $ */
+/* $OpenBSD: wscons_machdep.c,v 1.8 2010/07/18 13:36:14 miod Exp $ */
/*
* Copyright (c) 2010 Miodrag Vallat.
continue;
class = pci_conf_read_early(tag, PCI_CLASS_REG);
- if (!DEVICE_IS_VGA_PCI(class))
+ if (!DEVICE_IS_VGA_PCI(class) &&
+ !(PCI_CLASS(class) == PCI_CLASS_DISPLAY &&
+ PCI_SUBCLASS(class) == PCI_SUBCLASS_DISPLAY_MISC))
continue;
cp->cn_dev = makedev(maj, 0);
continue;
class = pci_conf_read_early(tag, PCI_CLASS_REG);
- if (!DEVICE_IS_VGA_PCI(class))
+ if (!DEVICE_IS_VGA_PCI(class) &&
+ !(PCI_CLASS(class) == PCI_CLASS_DISPLAY &&
+ PCI_SUBCLASS(class) == PCI_SUBCLASS_DISPLAY_MISC))
continue;
/*