diff options
author | Kevin Lo <kevlo@cvs.openbsd.org> | 2009-07-28 02:40:54 +0000 |
---|---|---|
committer | Kevin Lo <kevlo@cvs.openbsd.org> | 2009-07-28 02:40:54 +0000 |
commit | f8e51c9bbe07ec21d7a1a71f037ff1254022db55 (patch) | |
tree | e274017d878c36432386b18aaa16133ff8129548 | |
parent | a9eb95f32f6bf514b694cbd6b0d93f3dbf140536 (diff) |
Add flow control support
From Brad
-rw-r--r-- | sys/dev/pci/if_age.c | 6 | ||||
-rw-r--r-- | sys/dev/pci/if_ale.c | 11 |
2 files changed, 8 insertions, 9 deletions
diff --git a/sys/dev/pci/if_age.c b/sys/dev/pci/if_age.c index 742622c3c6d..fe0ac4ff0f0 100644 --- a/sys/dev/pci/if_age.c +++ b/sys/dev/pci/if_age.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_age.c,v 1.4 2009/03/29 21:53:52 sthen Exp $ */ +/* $OpenBSD: if_age.c,v 1.5 2009/07/28 02:40:53 kevlo Exp $ */ /*- * Copyright (c) 2008, Pyun YongHyeon <yongari@FreeBSD.org> @@ -262,7 +262,7 @@ age_attach(struct device *parent, struct device *self, void *aux) ifmedia_init(&sc->sc_miibus.mii_media, 0, age_mediachange, age_mediastatus); mii_attach(self, &sc->sc_miibus, 0xffffffff, MII_PHY_ANY, - MII_OFFSET_ANY, 0); + MII_OFFSET_ANY, MIIF_DOPAUSE); if (LIST_FIRST(&sc->sc_miibus.mii_phys) == NULL) { printf("%s: no PHY found!\n", sc->sc_dev.dv_xname); @@ -1156,12 +1156,10 @@ age_mac_config(struct age_softc *sc) } if ((IFM_OPTIONS(mii->mii_media_active) & IFM_FDX) != 0) { reg |= MAC_CFG_FULL_DUPLEX; -#ifdef notyet if ((IFM_OPTIONS(mii->mii_media_active) & IFM_ETH_TXPAUSE) != 0) reg |= MAC_CFG_TX_FC; if ((IFM_OPTIONS(mii->mii_media_active) & IFM_ETH_RXPAUSE) != 0) reg |= MAC_CFG_RX_FC; -#endif } CSR_WRITE_4(sc, AGE_MAC_CFG, reg); diff --git a/sys/dev/pci/if_ale.c b/sys/dev/pci/if_ale.c index ba04c589c04..979ba123df7 100644 --- a/sys/dev/pci/if_ale.c +++ b/sys/dev/pci/if_ale.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ale.c,v 1.4 2009/03/29 21:53:52 sthen Exp $ */ +/* $OpenBSD: if_ale.c,v 1.5 2009/07/28 02:40:53 kevlo Exp $ */ /*- * Copyright (c) 2008, Pyun YongHyeon <yongari@FreeBSD.org> * All rights reserved. @@ -372,7 +372,7 @@ ale_attach(struct device *parent, struct device *self, void *aux) const char *intrstr; struct ifnet *ifp; pcireg_t memtype; - int error = 0; + int mii_flags, error = 0; uint32_t rxf_len, txf_len; /* @@ -526,8 +526,11 @@ ale_attach(struct device *parent, struct device *self, void *aux) ifmedia_init(&sc->sc_miibus.mii_media, 0, ale_mediachange, ale_mediastatus); + mii_flags = 0; + if ((sc->ale_flags & ALE_FLAG_JUMBO) != 0) + mii_flags |= MIIF_DOPAUSE; mii_attach(self, &sc->sc_miibus, 0xffffffff, MII_PHY_ANY, - MII_OFFSET_ANY, 0); + MII_OFFSET_ANY, mii_flags); if (LIST_FIRST(&sc->sc_miibus.mii_phys) == NULL) { printf("%s: no PHY found!\n", sc->sc_dev.dv_xname); @@ -1153,12 +1156,10 @@ ale_mac_config(struct ale_softc *sc) } if ((IFM_OPTIONS(mii->mii_media_active) & IFM_FDX) != 0) { reg |= MAC_CFG_FULL_DUPLEX; -#ifdef notyet if ((IFM_OPTIONS(mii->mii_media_active) & IFM_ETH_TXPAUSE) != 0) reg |= MAC_CFG_TX_FC; if ((IFM_OPTIONS(mii->mii_media_active) & IFM_ETH_RXPAUSE) != 0) reg |= MAC_CFG_RX_FC; -#endif } CSR_WRITE_4(sc, ALE_MAC_CFG, reg); } |