diff options
author | Jason Wright <jason@cvs.openbsd.org> | 2002-04-18 19:11:19 +0000 |
---|---|---|
committer | Jason Wright <jason@cvs.openbsd.org> | 2002-04-18 19:11:19 +0000 |
commit | 36c7caf13d1d96dec21bae27533d4b416c6e3c76 (patch) | |
tree | 268ff264bce21216702dd6d647fde875b82659bb /sys/dev/ic | |
parent | ad977949dab4b3dec2641bc7f8664713f59fc40a (diff) |
add support for Conexant LANfinity RS7112; based on patch from Maurice Nonnekes <maurice@amaze.nl> based on FreeBSD (only minor surgery necessary)
Diffstat (limited to 'sys/dev/ic')
-rw-r--r-- | sys/dev/ic/dc.c | 29 | ||||
-rw-r--r-- | sys/dev/ic/dcreg.h | 13 |
2 files changed, 36 insertions, 6 deletions
diff --git a/sys/dev/ic/dc.c b/sys/dev/ic/dc.c index 6d588aeca05..622ce487d47 100644 --- a/sys/dev/ic/dc.c +++ b/sys/dev/ic/dc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dc.c,v 1.47 2002/03/14 01:26:54 millert Exp $ */ +/* $OpenBSD: dc.c,v 1.48 2002/04/18 19:11:18 jason Exp $ */ /* * Copyright (c) 1997, 1998, 1999 @@ -655,6 +655,15 @@ int dc_miibus_readreg(self, phy, reg) if (DC_IS_ADMTEK(sc) && phy != DC_ADMTEK_PHYADDR) return(0); + /* + * Note: the ukphy probs of the RS7112 report a PHY at + * MII address 0 (possibly HomePNA?) and 1 (ethernet) + * so we only respond to correct one. + */ + + if (DC_IS_CONEXANT(sc) && phy != DC_CONEXANT_PHYADDR) + return (0); + if (sc->dc_pmode != DC_PMODE_MII) { if (phy == (MII_NPHY - 1)) { switch(reg) { @@ -759,6 +768,8 @@ void dc_miibus_writereg(self, phy, reg, data) if (DC_IS_ADMTEK(sc) && phy != DC_ADMTEK_PHYADDR) return; + if (DC_IS_CONEXANT(sc) && phy != DC_CONEXANT_PHYADDR) + return; if (DC_IS_PNIC(sc)) { CSR_WRITE_4(sc, DC_PN_MII, DC_PN_MIIOPCODE_WRITE | @@ -1210,7 +1221,7 @@ void dc_setfilt(sc) struct dc_softc *sc; { if (DC_IS_INTEL(sc) || DC_IS_MACRONIX(sc) || DC_IS_PNIC(sc) || - DC_IS_PNICII(sc) || DC_IS_DAVICOM(sc)) + DC_IS_PNICII(sc) || DC_IS_DAVICOM(sc) || DC_IS_CONEXANT(sc)) dc_setfilt_21143(sc); if (DC_IS_ASIX(sc)) @@ -1394,7 +1405,7 @@ void dc_reset(sc) } if (DC_IS_ASIX(sc) || DC_IS_ADMTEK(sc) || DC_IS_XIRCOM(sc) || - DC_IS_INTEL(sc)) { + DC_IS_INTEL(sc) || DC_IS_CONEXANT(sc)) { DELAY(10000); DC_CLRBIT(sc, DC_BUSCTL, DC_BUSCTL_RESET); i = 0; @@ -1630,6 +1641,10 @@ void dc_attach(sc) break; case DC_TYPE_XIRCOM: break; + case DC_TYPE_CONEXANT: + bcopy(&sc->dc_srom + DC_CONEXANT_EE_NODEADDR, + &sc->arpcom.ac_enaddr, ETHER_ADDR_LEN); + break; default: dc_read_eeprom(sc, (caddr_t)&sc->arpcom.ac_enaddr, DC_EE_NODEADDR, 3, 0); @@ -2271,11 +2286,15 @@ void dc_txeof(sc) continue; } - if (DC_IS_XIRCOM(sc)) { + if (DC_IS_XIRCOM(sc) || DC_IS_CONEXANT(sc)) { /* * XXX: Why does my Xircom taunt me so? * For some reason it likes setting the CARRLOST flag - * even when the carrier is there. wtf?! */ + * even when the carrier is there. wtf?! + * Who knows, but Conexant chips have the + * same problem. Maybe they took lessons + * from Xircom. + */ if (/*sc->dc_type == DC_TYPE_21143 &&*/ sc->dc_pmode == DC_PMODE_MII && ((txstat & 0xFFFF) & ~(DC_TXSTAT_ERRSUM| diff --git a/sys/dev/ic/dcreg.h b/sys/dev/ic/dcreg.h index aa50f945255..51978e7d586 100644 --- a/sys/dev/ic/dcreg.h +++ b/sys/dev/ic/dcreg.h @@ -1,4 +1,4 @@ -/* $OpenBSD: dcreg.h,v 1.23 2002/04/16 21:29:54 jason Exp $ */ +/* $OpenBSD: dcreg.h,v 1.24 2002/04/18 19:11:18 jason Exp $ */ /* * Copyright (c) 1997, 1998, 1999 @@ -83,6 +83,7 @@ #define DC_TYPE_PNICII 0x9 /* 82c115 PNIC II */ #define DC_TYPE_PNIC 0xA /* 82c168/82c169 PNIC I */ #define DC_TYPE_XIRCOM 0xB /* Xircom X3201 */ +#define DC_TYPE_CONEXANT 0xC /* Conexant LANfinity RS7112 */ #define DC_IS_MACRONIX(x) \ (x->dc_type == DC_TYPE_98713 || \ @@ -101,6 +102,7 @@ #define DC_IS_PNICII(x) (x->dc_type == DC_TYPE_PNICII) #define DC_IS_PNIC(x) (x->dc_type == DC_TYPE_PNIC) #define DC_IS_XIRCOM(x) (x->dc_type == DC_TYPE_XIRCOM) +#define DC_IS_CONEXANT(x) (x->dc_type == DC_TYPE_CONEXANT) /* MII/symbol mode port types */ #define DC_PMODE_MII 0x1 @@ -679,6 +681,15 @@ struct dc_mii_frame { /* End of PNIC specific registers */ +/* + * CONEXANT specific registers. + */ + +#define DC_CONEXANT_PHYADDR 0x1 +#define DC_CONEXANT_EE_NODEADDR 0x19A + +/* End of CONEXANT specific register */ + struct dc_softc { struct device sc_dev; void *sc_ih; |