Skip site navigation (1)Skip section navigation (2)
Date:               Mon, 17 Jul 1995 16:11:00 EST5EDT
From:      "Andrew Webster" <awebster@dataradio.com>
To:        freebsd-questions@freebsd.org
Subject:         SMC8216/8416 Cards
Message-ID:  <199507172005.QAA00206@vhf.dataradio.com>

next in thread | raw e-mail | index | archive | help
Hi,

I've been trying to get FreeBSD 2.0.5-RELEASE to work using an SMC8416BT
(Ether EZ) card, but with no luck so far.

My first attempt uncovered a problem in the ed_probe routine which
incorrectly tries to determine what type of card it is (8216C or 8416C/BT).
The card is now correctly detected, but upon frame transmission, I get a
kernel panic.

I'd like to get this driver working for this card.  Any help would be
appreciated.

I've included the necessary patch to make this work properly.  On many
clone PC buses, a read on memory locations with no RAM will return the the
address, IE: A read at 0xD2000 will return 0.  This was confusing the
probe code to think that the card was an 8216.

Patch for if_ed.c for correct 8216C/8416C determination:


*** if_ed.c.old  Mon Jul 17 11:15:41 1995
--- if_ed.c Mon Jul 17 15:47:10 1995
***************
*** 279,284 ****
--- 279,285 ----
    int     i;
    u_int   memsize;
    u_char  iptr, isa16bit, sum;
+   unsigned int aw_smc_test;

    sc->asic_addr = isa_dev->id_iobase;
    sc->nic_addr = sc->asic_addr + ED_WD_NIC_OFFSET;
***************
*** 390,397 ****
        isa16bit = 1;
        break;
    case ED_TYPE_SMC8216C: /* 8216 has 16K shared mem -- 8416 has 8K */
!       (unsigned int) *(isa_dev->id_maddr+8192) = (unsigned int)0;
!       if ((unsigned int) *(isa_dev->id_maddr+8192)) {
            sc->type_str = "SMC8416C/SMC8416BT";
            sc->kdc.kdc_description =
                "Ethernet adapter: SMC 8416C or 8416BT";
--- 391,406 ----
        isa16bit = 1;
        break;
    case ED_TYPE_SMC8216C: /* 8216 has 16K shared mem -- 8416 has 8K */
!       /*
!        * A proper test is to take whatever value is at that memory
!        * location, negate it, and write it back.  Then check and
!        * see if the values read back negated corresponds to the
!        * original value.  If it does, there is definately RAM there!
!        */
!       aw_smc_test = (unsigned int) *(isa_dev->id_maddr+8192);
!       (unsigned int) *(isa_dev->id_maddr+8192) = aw_smc_test ^ 0xffff;
!       if ((unsigned int) *(isa_dev->id_maddr+8192) ^ 0xffff !=
!           aw_smc_test) {
            sc->type_str = "SMC8416C/SMC8416BT";
            sc->kdc.kdc_description =
                "Ethernet adapter: SMC 8416C or 8416BT";



-----------------------------------------------------------------------
  Andrew Webster   Network Manager / Special Projects
  Dataradio Inc.   200-5500 Royalmount Ave.      TEL: +1 514 737 0020
  Town of Mount Royal, QC, CANADA  H4P 1H7       FAX: +1 514 737 7883
  http://www.dataradio.com              Email: awebster@dataradio.com



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