From fab4f065825b97c44e03de38c4656883642486cc Mon Sep 17 00:00:00 2001 From: Warner Losh Date: Thu, 13 Oct 2005 22:06:02 +0000 Subject: o Fix probing of rtl80x9 parts. We shouldn't be calling ed_probe_generic8390 where we're calling it. It will be done as part of ed_probe_Novel_generic after things are setup in a way that ed_probe_generic8390 will grok. o Fix operator precedence botch that causes a panic when setting the media type for 10baseT connections. o Save the type of device so that it prints with the rest of the probe. # this should make it work with qemu again, but only if it has my patches # to actually implement the RTL8029 specific registers. --- sys/dev/ed/if_ed_rtl80x9.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'sys/dev') diff --git a/sys/dev/ed/if_ed_rtl80x9.c b/sys/dev/ed/if_ed_rtl80x9.c index f2c1a4373044..cec1b61890cd 100644 --- a/sys/dev/ed/if_ed_rtl80x9.c +++ b/sys/dev/ed/if_ed_rtl80x9.c @@ -75,14 +75,12 @@ int ed_probe_RTL80x9(device_t dev, int port_rid, int flags) { struct ed_softc *sc = device_get_softc(dev); + char *ts; int error; if ((error = ed_alloc_port(dev, port_rid, ED_NOVELL_IO_PORTS))) return (error); - if (!ed_probe_generic8390(sc)) - return (ENXIO); - if (ed_nic_inb(sc, ED_P0_CR) & (ED_CR_PS0 | ED_CR_PS1)) ed_nic_outb(sc, ED_P0_CR, ED_CR_RD2 | ED_CR_STP); @@ -92,9 +90,11 @@ ed_probe_RTL80x9(device_t dev, int port_rid, int flags) switch (ed_nic_inb(sc, ED_RTL80X9_80X9ID1)) { case ED_RTL8019_ID1: sc->chip_type = ED_CHIP_TYPE_RTL8019; + ts = "RTL8019"; break; case ED_RTL8029_ID1: sc->chip_type = ED_CHIP_TYPE_RTL8029; + ts = "RTL8029"; break; default: return (ENXIO); @@ -106,6 +106,7 @@ ed_probe_RTL80x9(device_t dev, int port_rid, int flags) if ((error = ed_probe_Novell_generic(dev, flags))) return (error); + sc->type_str = ts; sc->sc_media_ioctl = &ed_rtl80x9_media_ioctl; ifmedia_init(&sc->ifmedia, 0, ed_rtl_set_media, ed_rtl_get_media); @@ -129,8 +130,8 @@ ed_probe_RTL80x9(device_t dev, int port_rid, int flags) break; case ED_RTL80X9_CF2_10_T: ifmedia_set(&sc->ifmedia, IFM_ETHER | IFM_10_T | - (ed_nic_inb(sc, ED_RTL80X9_CONFIG3) - & ED_RTL80X9_CF3_FUDUP) ? IFM_FDX : 0); + ((ed_nic_inb(sc, ED_RTL80X9_CONFIG3) + & ED_RTL80X9_CF3_FUDUP) ? IFM_FDX : 0)); break; } return (0); -- cgit v1.2.3