diff options
author | Federico G. Schwindt <fgsch@cvs.openbsd.org> | 2002-11-20 15:19:34 +0000 |
---|---|---|
committer | Federico G. Schwindt <fgsch@cvs.openbsd.org> | 2002-11-20 15:19:34 +0000 |
commit | daa6ecbb5037969970ccdff19fe3bb48ef5df504 (patch) | |
tree | bffd016dcdb26e56b7d0b19958aeef4294540758 /sys/dev | |
parent | cb007ece077cb347a1c5cdedc21c0aedda206a82 (diff) |
Read mac address correctly on rev 0x90; tested by Alexander, patch
provided from FreeBSD via Gabriel Gonzalez.
jason@ ok.
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/pci/if_sis.c | 24 | ||||
-rw-r--r-- | sys/dev/pci/if_sisreg.h | 6 |
2 files changed, 17 insertions, 13 deletions
diff --git a/sys/dev/pci/if_sis.c b/sys/dev/pci/if_sis.c index abe52794e9d..3bc090dcac8 100644 --- a/sys/dev/pci/if_sis.c +++ b/sys/dev/pci/if_sis.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_sis.c,v 1.28 2002/11/19 18:40:17 jason Exp $ */ +/* $OpenBSD: if_sis.c,v 1.29 2002/11/20 15:19:33 fgsch Exp $ */ /* * Copyright (c) 1997, 1998, 1999 * Bill Paul <wpaul@ctr.columbia.edu>. All rights reserved. @@ -130,7 +130,7 @@ void sis_eeprom_getword(struct sis_softc *, int, u_int16_t *); #ifdef __i386__ void sis_read_cmos(struct sis_softc *, struct pci_attach_args *, caddr_t, int, int); #endif -void sis_read_630ea1_enaddr(struct sis_softc *, struct pci_attach_args *); +void sis_read_mac(struct sis_softc *, struct pci_attach_args *); void sis_read_eeprom(struct sis_softc *, caddr_t, int, int, int); int sis_miibus_readreg(struct device *, int, int); @@ -337,7 +337,7 @@ void sis_read_cmos(sc, pa, dest, off, cnt) } #endif -void sis_read_630ea1_enaddr(sc, pa) +void sis_read_mac(sc, pa) struct sis_softc *sc; struct pci_attach_args *pa; { @@ -384,7 +384,8 @@ int sis_miibus_readreg(self, phy, reg) return(val); } - if (sc->sis_type == SIS_TYPE_900 && phy != 0) + if (sc->sis_type == SIS_TYPE_900 && + sc->sis_rev < SIS_REV_635 && phy != 0) return(0); CSR_WRITE_4(sc, SIS_PHYCTL, (phy << 11) | (reg << 6) | SIS_PHYOP_READ); @@ -743,6 +744,8 @@ void sis_attach(parent, self, aux) } printf(": %s", intrstr); + sc->sis_rev = PCI_REVISION(pa->pa_class); + /* Reset the adapter. */ sis_reset(sc); @@ -803,17 +806,16 @@ void sis_attach(parent, self, aux) * requires some datasheets that I don't have access * to at the moment. */ - command = pci_conf_read(pc, pa->pa_tag, - PCI_CLASS_REG) & 0x000000ff; - if (command == SIS_REV_630S || - command == SIS_REV_630E) + if (sc->sis_rev == SIS_REV_630S || + sc->sis_rev == SIS_REV_630E || + sc->sis_rev == SIS_REV_630EA1) sis_read_cmos(sc, pa, (caddr_t)&sc->arpcom.ac_enaddr, 0x9, 6); else #endif - if (command == SIS_REV_630EA1 || - command == SIS_REV_630ET) - sis_read_630ea1_enaddr(sc, pa); + if (sc->sis_rev == SIS_REV_635 || + sc->sis_rev == SIS_REV_630ET) + sis_read_mac(sc, pa); else sis_read_eeprom(sc, (caddr_t)&sc->arpcom.ac_enaddr, SIS_EE_NODEADDR, 3, 0); diff --git a/sys/dev/pci/if_sisreg.h b/sys/dev/pci/if_sisreg.h index 8eb9711a478..e14e05e5450 100644 --- a/sys/dev/pci/if_sisreg.h +++ b/sys/dev/pci/if_sisreg.h @@ -1,4 +1,4 @@ -/* $OpenBSD: if_sisreg.h,v 1.10 2002/07/02 16:44:25 aaron Exp $ */ +/* $OpenBSD: if_sisreg.h,v 1.11 2002/11/20 15:19:33 fgsch Exp $ */ /* * Copyright (c) 1997, 1998, 1999 * Bill Paul <wpaul@ee.columbia.edu>. All rights reserved. @@ -371,7 +371,8 @@ struct sis_ring_data { #define SIS_REV_630E 0x0081 #define SIS_REV_630S 0x0082 #define SIS_REV_630EA1 0x0083 -#define SIS_REV_630ET 0x0084 +#define SIS_REV_630ET 0x0084 +#define SIS_REV_635 0x0090 struct sis_type { u_int16_t sis_vid; @@ -392,6 +393,7 @@ struct sis_softc { bus_space_tag_t sis_btag; u_int8_t sis_unit; u_int8_t sis_type; + u_int8_t sis_rev; u_int8_t sis_link; struct sis_list_data *sis_ldata; struct sis_ring_data sis_cdata; |