Subject: Re: kern/29925: support for Sundance 1023 NIC
To: None <kern-bug-people@netbsd.org, gnats-admin@netbsd.org,>
From: Mihai CHELARU <kefren@netbsd.ro>
List: netbsd-bugs
Date: 04/12/2005 07:47:01
The following reply was made to PR kern/29925; it has been noted by GNATS.

From: Mihai CHELARU <kefren@netbsd.ro>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: kern/29925: support for Sundance 1023 NIC
Date: Tue, 12 Apr 2005 10:46:00 +0300

 You wrote:
 
 > Please submit your diff as diff -u and include it in the PR. I think
 > that turning on STGE_CU_BUG which turns on promiscuous mode for everyone
 > is bad and could be done conditionally only for your card for now until
 > we figure out what is wrong.
 >  
 > christos
 
 I agree, STGE_CU_BUG is very bad. Here is the patch (some formatting may 
 be lost).
 
 Index: pcidevs
 ===================================================================
 RCS file: /cvsroot/src/sys/dev/pci/pcidevs,v
 retrieving revision 1.701
 diff -r1.701 pcidevs
 2639a2640
  > product       SUNDANCETI ST1023       0x1023  ST1023 Gigabit Ethernet
 Index: if_stge.c
 ===================================================================
 RCS file: /cvsroot/src/sys/dev/pci/if_stge.c,v
 retrieving revision 1.24
 diff -r1.24 if_stge.c
 85c85
 < /* #define    STGE_CU_BUG                     1 */
 ---
  > #define       STGE_CU_BUG                     1
 280d279
 < #if 0
 282d280
 < #endif
 333a332,334
  >       { PCI_VENDOR_SUNDANCETI,        PCI_PRODUCT_SUNDANCETI_ST1023,
  >         "Sundance ST-1023 Gigabit Ethernet" },
  >
 400a402
  >       uint16_t myaddr[ETHER_ADDR_LEN / 2];
 568c570,571
 <        * address registers.
 ---
  >        * address registers. Sundance ST1023 (as found on some
  >        * Abit mainboards) works fine with EEPROM.
 570,581c573,593
 <       enaddr[0] = bus_space_read_2(sc->sc_st, sc->sc_sh,
 <           STGE_StationAddress0) & 0xff;
 <       enaddr[1] = bus_space_read_2(sc->sc_st, sc->sc_sh,
 <           STGE_StationAddress0) >> 8;
 <       enaddr[2] = bus_space_read_2(sc->sc_st, sc->sc_sh,
 <           STGE_StationAddress1) & 0xff;
 <       enaddr[3] = bus_space_read_2(sc->sc_st, sc->sc_sh,
 <           STGE_StationAddress1) >> 8;
 <       enaddr[4] = bus_space_read_2(sc->sc_st, sc->sc_sh,
 <           STGE_StationAddress2) & 0xff;
 <       enaddr[5] = bus_space_read_2(sc->sc_st, sc->sc_sh,
 <           STGE_StationAddress2) >> 8;
 ---
  >       if (sp->stge_product != PCI_PRODUCT_SUNDANCETI_ST1023) {
  >           enaddr[0] = bus_space_read_2(sc->sc_st, sc->sc_sh,
  >               STGE_StationAddress0) & 0xff;
  >           enaddr[1] = bus_space_read_2(sc->sc_st, sc->sc_sh,
  >               STGE_StationAddress0) >> 8;
  >           enaddr[2] = bus_space_read_2(sc->sc_st, sc->sc_sh,
  >               STGE_StationAddress1) & 0xff;
  >           enaddr[3] = bus_space_read_2(sc->sc_st, sc->sc_sh,
  >               STGE_StationAddress1) >> 8;
  >           enaddr[4] = bus_space_read_2(sc->sc_st, sc->sc_sh,
  >               STGE_StationAddress2) & 0xff;
  >           enaddr[5] = bus_space_read_2(sc->sc_st, sc->sc_sh,
  >               STGE_StationAddress2) >> 8;
  >       } else {
  >           for (i=0; i<3; i++) {
  >               stge_read_eeprom(sc, STGE_EEPROM_StationAddress0 + i, 
 &myaddr[i]);
  >               myaddr[i] = le16toh(myaddr[i]);
  >           }
  >
  >           memcpy(enaddr, myaddr, sizeof(enaddr));
  >       }
 1758d1769
 < #if 0
 1793d1803
 < #endif /* 0 */
 
 -- 
 Mihai