Subject: RE: Intel Ether Express 16
To: 'netbsd-bugs' <netbsd-bugs@NetBSD.ORG>
From: John A. Maier <root@beta.datastorm.com>
List: netbsd-ports
Date: 02/13/1996 14:22:58
------ =_NextPart_000_01BAFA1E.E42B0F20
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

Digging though the src/sys/dev/isa/if_ie.c prob code, I discovered that =
the probe code only recognizes EXP16 cards with the memory-mapped buffer =
set to 32Kbytes.

1) My card was set to no memory-mapping (factory default), which is okay =
if you're running DOS ODI network drivers.

2) After looking through the code I realized I had to have =
memory-mapping turned on, so I ran the DOS Exp16 setup program softset.  =
So that point I didn't realize that the memory-mapping was set to only =
16Kbytes and the auto probe code wanted a 32K region.

3) I started hacking on the code and found that the memory-map codes =
being returned by my card were different from the code.  So I read the =
comments again and then realized that the memory-mapped area had to be a =
32K region.  Changed it via softset.exe and things began to work.

4) Just for fun I hacked the if_ie.c file to support 16K memory-mapped =
areas.  The comments imply that this wont work, but it does, at least =
for me.

         /* 16K buffer support, John A. Maier 02/13/96 14:22
         *
         *      Table for 16K buffers
         *      value   msize   location
         *      =3D=3D=3D=3D=3D   =3D=3D=3D=3D=3D   =
=3D=3D=3D=3D=3D=3D=3D=3D
         *      0x01    0x4000  0xCC000
         *      0x02    0x4000  0xD0000
         *      0x04    0x4000  0xD4000
         *      0x08    0x4000  0xD8000
         *
         *      Table for 32K buffers
         *      value   msize   location
         *      =3D=3D=3D=3D=3D   =3D=3D=3D=3D=3D   =
=3D=3D=3D=3D=3D=3D=3D=3D
         *      0x03    0x8000  0xCC000
         *      0x06    0x8000  0xD0000
         *      0x0C    0x8000  0xD4000
         *      0x18    0x8000  0xD8000
         *
         */

        if ((ia->ia_maddr =3D=3D MADDRUNK) || (ia->ia_msize =3D=3D 0)) {
                i =3D (ee16_read_eeprom(sc, 6) & 0x00ff ) >> 3;
                switch(i) {
                        case 0x01: /* 16K buffer size */
                                ia->ia_maddr =3D 0xCC000;
                                ia->ia_msize =3D 0xx4000;
                                break;
                        case 0x02: /* 16K buffer size */
                                ia->ia_maddr =3D 0xCC000;
                                ia->ia_msize =3D 0x4000;
                                break;
                        case 0x03: /* 32K buffer size */
                                ia->ia_maddr =3D 0xCC000;
                                ia->ia_msize =3D 0x8000;
                                break;
                        case 0x04: /* 16K buffer size */
                                ia->ia_maddr =3D 0xCC000;
                                ia->ia_msize =3D 0x4000;
                                break;
                        case 0x06: /* 32K buffer size */
                                ia->ia_maddr =3D 0xD0000;
                                ia->ia_msize =3D 0x8000;
                                break;
                        case 0x08: /* 16K buffer size */
                                ia->ia_maddr =3D 0xCC000;
                                ia->ia_msize =3D 0x4000;
                                break;
                        case 0x0c: /* 32K buffer size */
                                ia->ia_maddr =3D 0xD4000;
                                ia->ia_msize =3D 0x8000;
                                break;
                        case 0x18: /* 32K buffer size */
                                ia->ia_maddr =3D 0xD8000;
                                ia->ia_msize =3D 0x8000;
                                break;
                        default:
                                printf("ie: An EtherExpress 16 was =
detected but memory-mapping is turned off.\n);
                                printf("ie: Run the Exp16 DOS setup =
program softset.exe to correct this error.\n");
                                printf("ie: Set the Memory-Mapped =
Buffering to 32 Kbytes for optimal performance.\n");
                                return 0 ;
                                break; /* NOTREACHED */
                }
        }
        /*
	  * If the buffer is set to 16K inform the user to bump
        * the buffering up for better performance.
        */
        if(ia->ia_msize =3D=3D 0x4000)
                printf("ie: Set the Memory-Mapped Buffering to 32 Kbytes =
for optimal performance.\n");
=20
        /* need to set these after checking for MADDRUNK */
        sc->sc_maddr =3D ISA_HOLE_VADDR(ia->ia_maddr);
        sc->sc_msize =3D ia->ia_msize;

        /* need to put the 586 in RESET, and leave it */
        outb( PORT + IEE16_ECTRL, IEE16_RESET_586);

        /* read the eeprom and checksum it, should =3D=3D IEE16_ID */
        for(i=3D0 ; i< 0x40 ; i++)
                checksum +=3D ee16_read_eeprom(sc, i);

        if (checksum !=3D IEE16_ID)
                return 0;

        /*
         * Size and test the memory on the board.  The size of the =
memory
         * can be one of 16k, 32k, 48k or 64k.  It can be located in the
         * address range 0xC0000 to 0xEFFFF on 16k boundaries.
         *
         * If the size does not match the passed in memory allocation =
size
         * issue a warning, but continue with the minimum of the two =
sizes.
         */

        switch (ia->ia_msize) {
                case 65536:
                case 32768:
                case 16384:
                        break;
                case 49512:
                default:
                        printf("ieprobe mapped memory size out of =
range\n");
                        return 0;
                        break; /* NOTREACHED */
        }


I realize that a 32K buffer is better than 32K, but just getting the =
Intel EtherExpress 16 to work would have make me happier.  If there is =
some problem with using 16K buffers, it would be nice to at least inform =
the user, during auto-probe, to run the Intel EtherExpress 16 setup =
program and set the buffer size to 32K.  If a user doesn't have =
memory-mapping turned on, return a message informing the user to turn =
memory-mapping on.



        if ((ia->ia_maddr =3D=3D MADDRUNK) || (ia->ia_msize =3D=3D 0)) {
                i =3D (ee16_read_eeprom(sc, 6) & 0x00ff ) >> 3;
                switch(i) {
                        case 0x03: /* 32K buffer size */
                                ia->ia_maddr =3D 0xCC000;
                                ia->ia_msize =3D 0x8000;
                                break;
                        case 0x06: /* 32K buffer size */
                                ia->ia_maddr =3D 0xD0000;
                                ia->ia_msize =3D 0x8000;
                                break;
                        case 0x0c: /* 32K buffer size */
                                ia->ia_maddr =3D 0xD4000;
                                ia->ia_msize =3D 0x8000;
                                break;
                        case 0x18: /* 32K buffer size */
                                ia->ia_maddr =3D 0xD8000;
                                ia->ia_msize =3D 0x8000;
                                break;

                        case 0x01: /* 16K buffer size at 0xCC000*/
                        case 0x02: /* 16K buffer size at 0xD0000*/
                        case 0x04: /* 16K buffer size at 0xD4000*/
                        case 0x08: /* 16K buffer size at 0xD8000*/
                                printf("ie: In DOS, run the =
EtherExpress16 setup program, softset.exe");
                                printf("ie: Change Memory-Mapped Buffer =
to 32K.\n");=20
                                return 0 ;
                                break; /* 16K buffer size isn't current =
supported */
                        default:
                                printf("ie: An EtherExpress 16 was =
detected but memory-mapping is turned off.\n);
                                printf("ie: Run the Exp16 DOS setup =
program softset.exe to correct this error.\n");
                                printf("ie: Be sure to set the =
Memory-Mapped Buffering to 32 Kbytes.\n");
                                return 0 ;
                                break; /* NOTREACHED */
                }
        }

------ =_NextPart_000_01BAFA1E.E42B0F20
Content-Type: application/ms-tnef
Content-Transfer-Encoding: base64

eJ8+IjEUAQaQCAAEAAAAAAABAAEAAQeQBgAIAAAA5AQAAAAAAADoAAENgAQAAgAAAAIAAgABBJAG
APQEAAAEAAAADAAAAAMAADAMAAAACwAPDgEAAAACAf8PAQAAAGwAAAAAAAAAtTvCwCx3EBqhvAgA
KypWwhUAAAAMbNoIw4bOEbjsAKoAU2VMJIIAAAAAAACBKx+kvqMQGZ1uAN0BD1QCAAAAAG5ldGJz
ZC1idWdzAFNNVFAAbmV0YnNkLWJ1Z3NATmV0QlNELk9SRwAeAAIwAQAAAAUAAABTTVRQAAAAAB4A
AzABAAAAFwAAAG5ldGJzZC1idWdzQE5ldEJTRC5PUkcAAAMAFQwBAAAAAwD+DwYAAAAeAAEwAQAA
AA4AAAAnbmV0YnNkLWJ1Z3MnAAAAAgELMAEAAAAcAAAAU01UUDpORVRCU0QtQlVHU0BORVRCU0Qu
T1JHAAMAADkAAAAACwBAOgAAAAACAfYPAQAAAAQAAAAAAAAMDAAAAAMAADANAAAACwAPDgEAAAAC
Af8PAQAAAGwAAAAAAAAAtTvCwCx3EBqhvAgAKypWwhUAAAAMbNoIw4bOEbjsAKoAU2VM5IIAAAAA
AACBKx+kvqMQGZ1uAN0BD1QCAAAAAG5ldGJzZC1oZWxwAFNNVFAAbmV0YnNkLWhlbHBATmV0QlNE
Lk9SRwAeAAIwAQAAAAUAAABTTVRQAAAAAB4AAzABAAAAFwAAAG5ldGJzZC1oZWxwQE5ldEJTRC5P
UkcAAAMAFQwCAAAAAwD+DwYAAAAeAAEwAQAAAA4AAAAnbmV0YnNkLWhlbHAnAAAAAgELMAEAAAAc
AAAAU01UUDpORVRCU0QtSEVMUEBORVRCU0QuT1JHAAMAADkAAAAACwBAOgAAAAACAfYPAQAAAAQA
AAAAAA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