diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2007-02-11 22:16:22 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2007-02-11 22:16:22 +0000 |
commit | 669945b10ee06750b8ff9fc2d2e130e92c53d8ae (patch) | |
tree | b10064d45ffdeda32fe7df1835f3e73c9b166012 /sys | |
parent | a1007e478639aa42c91cb720b70fa738bfe860b5 (diff) |
Add support for fiber on 88E8021/22.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/pci/if_msk.c | 14 | ||||
-rw-r--r-- | sys/dev/pci/if_mskvar.h | 5 |
2 files changed, 14 insertions, 5 deletions
diff --git a/sys/dev/pci/if_msk.c b/sys/dev/pci/if_msk.c index 15c32b958fc..9812f3f4534 100644 --- a/sys/dev/pci/if_msk.c +++ b/sys/dev/pci/if_msk.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_msk.c,v 1.46 2007/02/10 23:19:34 kettenis Exp $ */ +/* $OpenBSD: if_msk.c,v 1.47 2007/02/11 22:16:21 kettenis Exp $ */ /* * Copyright (c) 1997, 1998, 1999, 2000 @@ -977,6 +977,7 @@ msk_attach(struct device *parent, struct device *self, void *aux) bus_dma_segment_t seg; int i, rseg; u_int32_t chunk, val; + int mii_flags; sc_if->sk_port = sa->skc_port; sc_if->sk_softc = sc; @@ -1087,8 +1088,11 @@ msk_attach(struct device *parent, struct device *self, void *aux) ifmedia_init(&sc_if->sk_mii.mii_media, 0, msk_ifmedia_upd, msk_ifmedia_sts); + mii_flags = MIIF_DOPAUSE|MIIF_FORCEANEG; + if (sc->sk_fibertype) + mii_flags = MIIF_HAVEFIBER; mii_attach(self, &sc_if->sk_mii, 0xffffffff, MII_PHY_ANY, - MII_OFFSET_ANY, MIIF_DOPAUSE|MIIF_FORCEANEG); + MII_OFFSET_ANY, mii_flags); if (LIST_FIRST(&sc_if->sk_mii.mii_phys) == NULL) { printf("%s: no PHY found!\n", sc_if->sk_dev.dv_xname); ifmedia_add(&sc_if->sk_mii.mii_media, IFM_ETHER|IFM_MANUAL, @@ -1148,7 +1152,7 @@ mskc_attach(struct device *parent, struct device *self, void *aux) pci_intr_handle_t ih; const char *intrstr = NULL; bus_size_t size; - u_int8_t hw, skrs; + u_int8_t hw, pmd, skrs; char *revstr = NULL; caddr_t kva; bus_dma_segment_t seg; @@ -1277,6 +1281,10 @@ mskc_attach(struct device *parent, struct device *self, void *aux) sc->sk_ramsize, sc->sk_ramsize / 1024, sc->sk_rboff)); + pmd = sk_win_read_1(sc, SK_PMDTYPE); + if (pmd == 'L' || pmd == 'S' || pmd == 'P') + sc->sk_fibertype = 1; + switch (sc->sk_type) { case SK_YUKON_XL: sc->sk_name = "Yukon-2 XL"; diff --git a/sys/dev/pci/if_mskvar.h b/sys/dev/pci/if_mskvar.h index 9c852d56680..ce9ab920aa9 100644 --- a/sys/dev/pci/if_mskvar.h +++ b/sys/dev/pci/if_mskvar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: if_mskvar.h,v 1.3 2006/12/28 16:34:42 kettenis Exp $ */ +/* $OpenBSD: if_mskvar.h,v 1.4 2007/02/11 22:16:21 kettenis Exp $ */ /* $NetBSD: if_skvar.h,v 1.6 2005/05/30 04:35:22 christos Exp $ */ /*- @@ -33,7 +33,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ -/* $OpenBSD: if_mskvar.h,v 1.3 2006/12/28 16:34:42 kettenis Exp $ */ +/* $OpenBSD: if_mskvar.h,v 1.4 2007/02/11 22:16:21 kettenis Exp $ */ /* * Copyright (c) 1997, 1998, 1999, 2000 @@ -193,6 +193,7 @@ struct sk_softc { bus_space_handle_t sk_bhandle; /* bus space handle */ bus_space_tag_t sk_btag; /* bus space tag */ void *sk_intrhand; /* irq handler handle */ + u_int8_t sk_fibertype; u_int8_t sk_type; u_int8_t sk_rev; u_int8_t sk_macs; /* # of MACs */ |