From owner-freebsd-hackers@FreeBSD.ORG Sat Jan 23 18:02:08 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A6AD8106566B for ; Sat, 23 Jan 2010 18:02:08 +0000 (UTC) (envelope-from g.veniamin@googlemail.com) Received: from mail-ew0-f211.google.com (mail-ew0-f211.google.com [209.85.219.211]) by mx1.freebsd.org (Postfix) with ESMTP id 2AE308FC16 for ; Sat, 23 Jan 2010 18:02:07 +0000 (UTC) Received: by ewy3 with SMTP id 3so911246ewy.13 for ; Sat, 23 Jan 2010 10:02:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:received:received:from:to:subject:date :user-agent:mime-version:content-type:content-transfer-encoding :message-id; bh=2xYJ6Q+ti2A07Qq4BUxSez0ru2Phkzh90E4rsScuCr4=; b=U7B53YhS+Zetcc7tbuyqOo31Az+tb3+6RfRoJypXtE8kAux79l19XFjVpciaR6O1F+ Ng5aHBoytG/yb5stwXZocTfbpOVYxsTyrGir8bUjn5o/N8W0nh6w0xjbrwIgOHtVa4cZ cKotHenurnj7rioOFYJk8o9Sj56WPRPQqf8ic= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=from:to:subject:date:user-agent:mime-version:content-type :content-transfer-encoding:message-id; b=dRCts/FGKKDBBU1MV2G22U3558dBErIQ7f5ussV5JPSjFGlxkVsI8CP/Xr7biYzZfn 68+x5IiFe2PbzLlT2bTR2RgHzWU2cPsuEnlev8bvTnj3O15XjMSAkjcAxjzNTxUZBDkY +lVFGnZTZwg5WgaqFRqcWpHacblm5IwXt5ZIw= Received: by 10.213.2.81 with SMTP id 17mr1403064ebi.83.1264269726989; Sat, 23 Jan 2010 10:02:06 -0800 (PST) Received: from zlobook.local (zloidemon.kraslan.ru [94.78.205.21]) by mx.google.com with ESMTPS id 14sm2917896ewy.3.2010.01.23.10.02.04 (version=SSLv3 cipher=RC4-MD5); Sat, 23 Jan 2010 10:02:05 -0800 (PST) From: zloidemon To: freebsd-hackers@freebsd.org Date: Sun, 24 Jan 2010 01:01:53 +0700 User-Agent: KMail/1.12.4 (FreeBSD/8.0-STABLE; KDE/4.3.4; i386; ; ) MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Message-Id: <201001240101.54360.g.veniamin@googlemail.com> Subject: ethernet SiS(190/191) problem driver X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Jan 2010 18:02:08 -0000 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: port 0x1000-0x107f mem 0xd3307000-0xd330707f irq 19 at device 4.0 on pci0 miibus0: on sis19x0 rlphy0: 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?