From owner-freebsd-hackers Wed Nov 5 05:21:52 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id FAA09324 for hackers-outgoing; Wed, 5 Nov 1997 05:21:52 -0800 (PST) (envelope-from owner-freebsd-hackers) Received: from implode.root.com (implode.root.com [198.145.90.17]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id FAA09314; Wed, 5 Nov 1997 05:21:38 -0800 (PST) (envelope-from root@implode.root.com) Received: from implode.root.com (localhost [127.0.0.1]) by implode.root.com (8.8.5/8.8.5) with ESMTP id FAA29882; Wed, 5 Nov 1997 05:24:07 -0800 (PST) Message-Id: <199711051324.FAA29882@implode.root.com> To: nnd@itfs.nsk.su cc: hackers@FreeBSD.ORG, bde@FreeBSD.ORG Subject: Re: Cyclades :( In-reply-to: Your message of "05 Nov 1997 12:30:04 GMT." <63posc$6c2@news.itfs.nsk.su> From: David Greenman Reply-To: dg@root.com Date: Wed, 05 Nov 1997 05:24:07 -0800 Sender: owner-freebsd-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk You're right - it appears the Bruce messed up the offsets when he "fixed" the style/indentation. I don't have a -current machine here with the Cyclom-Y in it, so I didn't notice the brokeness. Bruce? -DG David Greenman Core-team/Principal Architect, The FreeBSD Project >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 >