Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 05 Nov 1997 05:24:07 -0800
From:      David Greenman <dg@root.com>
To:        nnd@itfs.nsk.su
Cc:        hackers@FreeBSD.ORG, bde@FreeBSD.ORG
Subject:   Re: Cyclades :( 
Message-ID:  <199711051324.FAA29882@implode.root.com>
In-Reply-To: Your message of "05 Nov 1997 12:30:04 GMT." <63posc$6c2@news.itfs.nsk.su> 

next in thread | previous in thread | raw e-mail | index | archive | help
   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 <dg@root.com> 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
>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199711051324.FAA29882>