diff options
author | imp <imp@FreeBSD.org> | 2005-10-13 22:12:34 +0000 |
---|---|---|
committer | imp <imp@FreeBSD.org> | 2005-10-13 22:12:34 +0000 |
commit | 403d9ed596497ec565802be66a88a66c846893e5 (patch) | |
tree | 843047414098fb359bc7ea097f6a3494097d3ede /sys/dev/ed | |
parent | d61867ee80272ea209a0ab641788cb75f7197011 (diff) | |
download | FreeBSD-src-403d9ed596497ec565802be66a88a66c846893e5.zip FreeBSD-src-403d9ed596497ec565802be66a88a66c846893e5.tar.gz |
If we can't probe the RTL80x9 for some reason, fall back to probing it
as a Novell NE-2000. This is necessary for unpatched qemu working
correctly. qemu claims to be a RTL8029, but doesn't implement the
RTL8029 specific registers at this time. I've created patches for
that, but there's no reason we can't use qemu's emulation w/o these
patches. This should make life easier for those folks that boot
FreeBSD via qemu.
Diffstat (limited to 'sys/dev/ed')
-rw-r--r-- | sys/dev/ed/if_ed_pci.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/sys/dev/ed/if_ed_pci.c b/sys/dev/ed/if_ed_pci.c index bdb3e73..67a655f 100644 --- a/sys/dev/ed/if_ed_pci.c +++ b/sys/dev/ed/if_ed_pci.c @@ -82,11 +82,18 @@ ed_pci_attach(device_t dev) { struct ed_softc *sc = device_get_softc(dev); int flags = 0; - int error; - + int error = ENXIO; + + /* + * If this card claims to be a RTL8029, probe it as such. + * However, allow that probe to fail. Some versions of qemu + * claim to be a 8029 in the PCI register, but it doesn't + * implement the 8029 specific registers. In that case, fall + * back to a normal NE2000. + */ if (pci_get_devid(dev) == ED_RTL8029_PCI_ID) error = ed_probe_RTL80x9(dev, PCIR_BAR(0), flags); - else + if (error) error = ed_probe_Novell(dev, PCIR_BAR(0), flags); if (error) { ed_release_resources(dev); |