Date: Sun, 24 Jan 2010 01:01:53 +0700 From: zloidemon <g.veniamin@googlemail.com> To: freebsd-hackers@freebsd.org Subject: ethernet SiS(190/191) problem driver Message-ID: <201001240101.54360.g.veniamin@googlemail.com>
next in thread | raw e-mail | index | archive | help
Hi all! zlobook# uname -a FreeBSD zlobook.local 8.0-STABLE FreeBSD 8.0-STABLE #22: Sun Jan 3 12:17:19 KRAT 2010 root@zlobook.local:/usr/obj/usr/src/sys/zlobook i386 none0@pci0:0:4:0: class=0x020000 card=0x08021558 chip=0x01911039 rev=0x02 hdr=0x00 vendor = 'Silicon Integrated Systems (SiS)' device = 'SIS190 (SIS190)' class = network subclass = ethernet this is chip=0x01911039 real SiS191 ethernet card i downloaded this is driver for sis 190 from http://pohoyda.gmxhome.de/sis190- freebsd-7.tar.gz a problem when compiling.... zlobook# make Warning: Object directory not changed from original /root/123/sis190-FreeBSD-7 @ -> /usr/src/sys machine -> /usr/src/sys/i386/include awk -f @/tools/makeobjops.awk @/kern/device_if.m -h awk -f @/tools/makeobjops.awk @/kern/bus_if.m -h awk -f @/tools/makeobjops.awk @/dev/pci/pci_if.m -h awk -f @/tools/makeobjops.awk @/dev/mii/miibus_if.m -h cc -O2 -pipe -fno-strict-aliasing -Werror -D_KERNEL -DKLD_MODULE -nostdinc - I. -I@ -I@/contrib/altq -finline-limit=8000 --param inline-unit-growth=100 -- param large-function-growth=1000 -fno-common -mno-align-long-strings - mpreferred-stack-boundary=2 -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -ffreestanding -fstack-protector -std=iso9899:1999 -fstack-protector -Wall - Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes - Wpointer-arith -Winline -Wcast-qual -Wundef -Wno-pointer-sign -fformat- extensions -c if_sis19x.c cc1: warnings being treated as errors if_sis19x.c:148: warning: pointer type mismatch in conditional expression *** Error code 1 Stop in /root/sis190-FreeBSD-7. I made a patch for the driver. Now support SiS 191 and SiS 190. Tested only SiS 191 --- if_sis19x.c.orig 2008-04-23 11:53:14.000000000 +0800 +++ if_sis19x.c 2010-01-24 00:06:43.000000000 +0700 @@ -92,13 +92,14 @@ MODULE_DEPEND(sis, miibus, 1, 1, 1); */ static struct sis_type sis19x_devs[] = { { SIS_VENDORID, SIS_DEVICEID_190, "SiS 190 10/100BaseTX" }, + { SIS_VENDORID, SIS_DEVICEID_191, "SiS 190 10/100BaseTX" }, { 0, 0, NULL } }; static int sis_probe (device_t); static int sis_attach (device_t); static int sis_detach (device_t); -static void sis_shutdown (device_t); +static int sis_shutdown (device_t); static int sis_miibus_readreg (device_t, int, int); static int sis_miibus_writereg (device_t, int, int, int); @@ -621,12 +622,14 @@ sis_attach(dev) MTX_DEF | MTX_RECURSE); callout_init_mtx(&sc->sis_stat_ch, &sc->sis_mtx, 0); - if (pci_get_device(dev) != SIS_DEVICEID_190) { - error = ENXIO; + if (pci_get_device(dev) == SIS_DEVICEID_190) + sc->sis_type = SIS_TYPE_190; + else if (pci_get_device(dev) == SIS_DEVICEID_191) + sc->sis_type = SIS_TYPE_190; + else { + error =ENXIO; goto fail; } - - sc->sis_type = SIS_TYPE_190; sc->sis_rev = pci_read_config(dev, PCIR_REVID, 1); /* @@ -885,8 +888,9 @@ sis_detach(dev) /* * Stop all chip I/O so that the kernel's probe routines don't * get confused by errant DMAs when rebooting. - */ -static void +*/ + +static int sis_shutdown(dev) device_t dev; { @@ -898,6 +902,7 @@ sis_shutdown(dev) sis_reset(sc); sis_stop(sc); SIS_UNLOCK(sc); + return (0); } this is log from messages when i using this is driver. pci0: driver added found-> vendor=0x1039, dev=0x0191, revid=0x02 domain=0, bus=0, slot=4, func=0 class=02-00-00, hdrtype=0x00, mfdev=0 cmdreg=0x0007, statreg=0x0210, cachelnsz=0 (dwords) lattimer=0x00 (0 ns), mingnt=0x00 (0 ns), maxlat=0x00 (0 ns) intpin=a, irq=19 powerspec 2 supports D0 D1 D2 D3 current D0 pci0:0:4:0: reprobing on driver added sis19x0: <SiS 190 10/100BaseTX> port 0x1000-0x107f mem 0xd3307000-0xd330707f irq 19 at device 4.0 on pci0 miibus0: <MII bus> on sis19x0 rlphy0: <RTL8201L 10/100 media interface> PHY 1 on miibus0 rlphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto sis19x0: bpf attached sis19x0: Ethernet address: 00:90:f5:95:05:e9 ioapic0: routing intpin 19 (PCI IRQ 19) to lapic 1 vector 53 sis19x0: [MPSAFE] sis19x0: [ITHREAD] pci1: driver added pci3: driver added found-> vendor=0x197b, dev=0x2382, revid=0x20 domain=0, bus=3, slot=0, func=0 class=08-80-00, hdrtype=0x00, mfdev=1 cmdreg=0x0007, statreg=0x0010, cachelnsz=4 (dwords) lattimer=0x00 (0 ns), mingnt=0x00 (0 ns), maxlat=0x00 (0 ns) intpin=a, irq=16 powerspec 3 supports D0 D3 current D0 MSI supports 1 message pci0:3:0:0: reprobing on driver added found-> vendor=0x197b, dev=0x2383, revid=0x20 domain=0, bus=3, slot=0, func=3 class=08-80-00, hdrtype=0x00, mfdev=1 cmdreg=0x0007, statreg=0x0010, cachelnsz=4 (dwords) lattimer=0x00 (0 ns), mingnt=0x00 (0 ns), maxlat=0x00 (0 ns) intpin=a, irq=16 powerspec 3 supports D0 D3 current D0 MSI supports 1 message pci0:3:0:3: reprobing on driver added pci9: driver added The device successfully identified sis19x0@pci0:0:4:0: class=0x020000 card=0x08021558 chip=0x01911039 rev=0x02 hdr=0x00 vendor = 'Silicon Integrated Systems (SiS)' device = 'SIS190 (SIS190)' class = network subclass = ethernet i see a problem every 10-30 seconds sis19x0: error_bits=0x40020001 sis19x0: watchdog timeout sis19x0: watchdog timeout sis19x0: watchdog timeout sis19x0: watchdog timeout sis19x0: watchdog timeout sis19x0: watchdog timeout sis19x0: error_bits=0x40020001 sis19x0: watchdog timeout 64 bytes from 192.168.3.100: icmp_seq=52 ttl=128 time=0.256 ms 64 bytes from 192.168.3.100: icmp_seq=53 ttl=128 time=0.272 ms 64 bytes from 192.168.3.100: icmp_seq=54 ttl=128 time=0.294 ms 64 bytes from 192.168.3.100: icmp_seq=55 ttl=128 time=4148.943 ms 64 bytes from 192.168.3.100: icmp_seq=56 ttl=128 time=3150.245 ms 64 bytes from 192.168.3.100: icmp_seq=57 ttl=128 time=2148.678 ms 64 bytes from 192.168.3.100: icmp_seq=58 ttl=128 time=1148.346 ms 64 bytes from 192.168.3.100: icmp_seq=59 ttl=128 time=147.464 ms 64 bytes from 192.168.3.100: icmp_seq=60 ttl=128 time=0.111 ms somehow fix this possible?
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201001240101.54360.g.veniamin>