diff options
Diffstat (limited to 'sys/dev/pci')
-rw-r--r-- | sys/dev/pci/if_xl.c | 57 | ||||
-rw-r--r-- | sys/dev/pci/if_xlreg.h | 8 |
2 files changed, 37 insertions, 28 deletions
diff --git a/sys/dev/pci/if_xl.c b/sys/dev/pci/if_xl.c index 2c598717880..e0231c4cee5 100644 --- a/sys/dev/pci/if_xl.c +++ b/sys/dev/pci/if_xl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_xl.c,v 1.10 1998/09/23 20:48:46 jason Exp $ */ +/* $OpenBSD: if_xl.c,v 1.11 1998/09/29 02:14:29 jason Exp $ */ /* * Copyright (c) 1997, 1998 @@ -31,7 +31,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. * - * $FreeBSD: if_xl.c,v 1.11 1998/09/08 23:42:10 wpaul Exp $ + * $FreeBSD: if_xl.c,v 1.12 1998/09/25 17:34:19 wpaul Exp $ */ /* @@ -194,7 +194,7 @@ #if !defined(lint) && !defined(__OpenBSD__) static char rcsid[] = - "$FreeBSD: if_xl.c,v 1.11 1998/09/08 23:42:10 wpaul Exp $"; + "$FreeBSD: if_xl.c,v 1.12 1998/09/25 17:34:19 wpaul Exp $"; #endif #ifdef __FreeBSD__ @@ -871,6 +871,14 @@ static void xl_autoneg_mii(sc, flag, verbose) if (verbose) printf("xl%d: autonegotiation not supported\n", sc->xl_unit); + ifm->ifm_media = IFM_ETHER|IFM_10_T|IFM_HDX; + media = xl_phy_readreg(sc, PHY_BMCR); + media &= ~PHY_BMCR_SPEEDSEL; + media &= ~PHY_BMCR_DUPLEX; + xl_phy_writereg(sc, PHY_BMCR, media); + CSR_WRITE_1(sc, XL_W3_MAC_CTRL, + (CSR_READ_1(sc, XL_W3_MAC_CTRL) & + ~XL_MACCTRL_DUPLEX)); return; } #endif @@ -972,7 +980,14 @@ static void xl_autoneg_mii(sc, flag, verbose) xl_phy_writereg(sc, PHY_BMCR, media); } else { if (verbose) - printf("no carrier\n"); + printf("no carrier (forcing half-duplex, 10Mbps)\n"); + ifm->ifm_media = IFM_ETHER|IFM_10_T|IFM_HDX; + media &= ~PHY_BMCR_SPEEDSEL; + media &= ~PHY_BMCR_DUPLEX; + xl_phy_writereg(sc, PHY_BMCR, media); + CSR_WRITE_1(sc, XL_W3_MAC_CTRL, + (CSR_READ_1(sc, XL_W3_MAC_CTRL) & + ~XL_MACCTRL_DUPLEX)); } xl_init(sc); @@ -1705,12 +1720,12 @@ xl_attach(config_id, unit) xl_setmode(sc, media); break; case XL_XCVR_AUTO: - media = IFM_ETHER|IFM_AUTO; #ifdef XL_BACKGROUND_AUTONEG xl_autoneg_mii(sc, XL_FLAG_SCHEDDELAY, 1); #else xl_autoneg_mii(sc, XL_FLAG_FORCEDELAY, 1); #endif + media = sc->ifmedia.ifm_media; break; case XL_XCVR_100BTX: case XL_XCVR_MII: @@ -2322,28 +2337,16 @@ static void xl_start(ifp) } /* - * If the OACTIVE flag is set, make sure the transmitter - * isn't wedged. Call the txeoc handler to make sure the - * transmitter is enabled and then call the txeof handler - * to see if any descriptors can be reclaimed and reload - * the downlist pointer register if necessary. If after - * that the OACTIVE flag is still set, return, otherwise - * proceed and queue up some more frames. - */ - if (ifp->if_flags & IFF_OACTIVE) { - xl_txeoc(sc); - xl_txeof(sc); - if (ifp->if_flags & IFF_OACTIVE) - return; - } - - /* * Check for an available queue slot. If there are none, * punt. */ if (sc->xl_cdata.xl_tx_free == NULL) { - ifp->if_flags |= IFF_OACTIVE; - return; + xl_txeoc(sc); + xl_txeof(sc); + if (sc->xl_cdata.xl_tx_free == NULL) { + ifp->if_flags |= IFF_OACTIVE; + return; + } } start_tx = sc->xl_cdata.xl_tx_free; @@ -2817,6 +2820,12 @@ static void xl_watchdog(ifp) printf("xl%d: no carrier - transceiver cable problem?\n", sc->xl_unit); xl_txeoc(sc); + xl_txeof(sc); + xl_rxeof(sc); + xl_init(sc); + + if (ifp->if_snd.ifq_head != NULL) + xl_start(ifp); return; } @@ -3270,12 +3279,12 @@ xl_attach(parent, self, aux) xl_setmode(sc, media); break; case XL_XCVR_AUTO: - media = IFM_ETHER|IFM_AUTO; #ifdef XL_BACKGROUND_AUTONEG xl_autoneg_mii(sc, XL_FLAG_SCHEDDELAY, 1); #else xl_autoneg_mii(sc, XL_FLAG_FORCEDELAY, 1); #endif + media = sc->ifmedia.ifm_media; break; case XL_XCVR_100BTX: case XL_XCVR_MII: diff --git a/sys/dev/pci/if_xlreg.h b/sys/dev/pci/if_xlreg.h index e4395c5abc6..413430dbf6c 100644 --- a/sys/dev/pci/if_xlreg.h +++ b/sys/dev/pci/if_xlreg.h @@ -1,4 +1,4 @@ -/* $OpenBSD: if_xlreg.h,v 1.5 1998/09/09 22:06:57 jason Exp $ */ +/* $OpenBSD: if_xlreg.h,v 1.6 1998/09/29 02:14:29 jason Exp $ */ /* * Copyright (c) 1997, 1998 @@ -31,7 +31,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. * - * $FreeBSD: if_xlreg.h,v 1.4 1998/09/04 16:22:15 wpaul Exp $ + * $FreeBSD: if_xlreg.h,v 1.5 1998/09/25 17:34:19 wpaul Exp $ */ #define XL_EE_READ 0x0080 /* read, 5 bit address */ @@ -166,7 +166,7 @@ #define XL_STAT_INTREQ 0x0040 /* 6 */ #define XL_STAT_STATSOFLOW 0x0080 /* 7 */ #define XL_STAT_DMADONE 0x0100 /* 8 first generation */ -#define XL_STAT_LINKSTAT 0x0100 /* 8 3c509B */ +#define XL_STAT_LINKSTAT 0x0100 /* 8 3c905B */ #define XL_STAT_DOWN_COMPLETE 0x0200 /* 9 */ #define XL_STAT_UP_COMPLETE 0x0400 /* 10 */ #define XL_STAT_DMABUSY 0x0800 /* 11 first generation */ @@ -439,7 +439,7 @@ struct xl_list_onefrag { #define XL_MAXFRAGS 63 #define XL_RX_LIST_CNT 16 -#define XL_TX_LIST_CNT 10 +#define XL_TX_LIST_CNT 16 #define XL_MIN_FRAMELEN 60 struct xl_list_data { |