From owner-freebsd-hackers Wed Nov 5 04:40:12 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id EAA07526 for hackers-outgoing; Wed, 5 Nov 1997 04:40:12 -0800 (PST) (envelope-from owner-freebsd-hackers) Received: from gw.itfs.nsk.su (gw.itfs.nsk.su [193.124.36.33]) by hub.freebsd.org (8.8.7/8.8.7) with SMTP id EAA07520 for ; Wed, 5 Nov 1997 04:40:07 -0800 (PST) (envelope-from itfs!news!nnd%itfs.nsk.su@gw.itfs.nsk.su) Received: from itfs.UUCP (root@localhost) by gw.itfs.nsk.su (8.6.12/8.6.12) with UUCP id SAA10861 for hackers@freebsd.org; Wed, 5 Nov 1997 18:40:02 +0600 Received: by itfs.nsk.su; Wed, 5 Nov 97 18:43:19 +0600 (NSK) Received: (from daemon@localhost) by news.itfs.nsk.su (8.7.5/8.6.12) id SAA11816; Wed, 5 Nov 1997 18:30:07 +0600 (NSK) From: nnd@itfs.nsk.su To: hackers@freebsd.org Subject: Re: Cyclades :( Date: 5 Nov 1997 12:30:04 GMT Message-ID: <63posc$6c2@news.itfs.nsk.su> References: <199711011653.IAA03064@implode.root.com> Sender: owner-freebsd-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk David Greenman wrote: > > Driver's text inspection shows that there is ONLY ONE > >significant difference with 'standard FreeBSD's' cy-driver: > >(this is a 'diff -bu' result for /sys/i386/isa/cy.c version > >1.55 of 1997/09/21) > > > >--- cy.c.ORIG Sat Nov 1 13:33:19 1997 > >+++ cy.c Sat Nov 1 13:36:55 1997 > >@@ -410,7 +404,7 @@ > > #endif > > > > static int cy_chip_offset[] = { > >- 0x0000, 0x0200, 0x0400, 0x0600, 0x0100, 0x0300, 0x0500, 0x0700, > >+ 0x0000, 0x0400, 0x0800, 0x0c00, 0x0200, 0x0600, 0x0a00, 0x0e00 > > }; > > static int cy_nr_cd1400s[NCY]; > > static int cy_total_devices; > > > > > > Can someone with Cyclom-8/16YeP (and problems ;-) > >test this patch ? I myself can not test it because my only ONE > >Cyclom-16YeP now busily serves 12 modems on Linux box. > > > > Partial "correctnes proof" for this patch can be found > >in (working) Linux 'cy' (or 'cz') driver which uses the same > >chip_offset addresses as in "patched" driver, but not as in > >original FreeBSD's 'cy' driver. > If you look at the cy_inb/cy_outb functions in cyreg.h, you'll see that > the offset is adjusted (shifted left by one bit) for the PCI card, making > the appropriate adjustment. The above change (which has the left shift built > in to the numbers) would effectively double this shift. What I'm saying is > that unless I'm really missing something, the patch can't be correct. I still can not test proposed patch with my only one Cyclom-16YeP, so I spend some time and find the 'correctness proof' for this patch in CVS/commitlogs ;-) First - exerpt from CVS/CVSROOT/commitlogs/sys: >bde 1997/09/02 18:50:25 PDT > > Modified files: > sys/i386/isa cy.c > Log: > Cleaned up revs 1.36-1.40 (mainly disordered declarations, non-bogus > indentation (it is supposed to be bogus to match sio.c), and long lines). > > Revision Changes Path > 1.53 +147 -121 src/sys/i386/isa/cy.c Second - exerpt from cvs ... diff -u -r1.52 -r1.53 src/sys/i386/isa/cy.c >@@ -404,20 +406,13 @@ > static u_int cy_timeouts; > #endif > >+static int cy_chip_offset[] = { >+ 0x0000, 0x0200, 0x0400, 0x0600, 0x0100, 0x0300, 0x0500, 0x0700, >+}; > static int cy_nr_cd1400s[NCY]; > static int cy_total_devices; > #undef RxFifoThreshold > static int volatile RxFifoThreshold = (CD1400_RX_FIFO_SIZE / 2); >-static int cy_chip_offset[] = { >- 0x0000, >- 0x0400, >- 0x0800, >- 0x0c00, >- 0x0200, >- 0x0600, >- 0x0a00, >- 0x0e00 >-}; > > static int > sioprobe(dev) Here you can see (unexplained in the commitlog) "division by 2" operation on the 'cy_chip_offset' array elements. Either Bruce Evans can explain his patch or we can revert this part of it (i.e. cy_chip_offset array values "division by 2"). More over - the diffs which can be found on the Cyclades ftp site for FreeBSD-2.1.[56] and serves to add PCI support for previous version of 'cy' driver contains the same declaration for cy_chip_offset array as in FreeBSD's rev. 1.52 of src/sys/i386/isa/cy.c. N.Dudorov