summaryrefslogtreecommitdiff
path: root/sys/dev/pci/if_fxp.c
diff options
context:
space:
mode:
authorJason Wright <jason@cvs.openbsd.org>2000-01-08 05:54:45 +0000
committerJason Wright <jason@cvs.openbsd.org>2000-01-08 05:54:45 +0000
commit5f74620e630e8d9592e0d77f76bda85275f276da (patch)
tree688fe318e8fcf2d479778ca4eb985d7c17ca4d24 /sys/dev/pci/if_fxp.c
parent853695369cdb3a6a7cb02ae8e7a856f1698191fa (diff)
before setting IFM_AUTO, make sure it really exists. If not, punt with
IFM_10_T. Also remove long dead fxp_phyname()
Diffstat (limited to 'sys/dev/pci/if_fxp.c')
-rw-r--r--sys/dev/pci/if_fxp.c32
1 files changed, 5 insertions, 27 deletions
diff --git a/sys/dev/pci/if_fxp.c b/sys/dev/pci/if_fxp.c
index b9b43d0a82f..12882c12b1c 100644
--- a/sys/dev/pci/if_fxp.c
+++ b/sys/dev/pci/if_fxp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_fxp.c,v 1.22 1999/11/11 16:23:19 provos Exp $ */
+/* $OpenBSD: if_fxp.c,v 1.23 2000/01/08 05:54:44 jason Exp $ */
/* $NetBSD: if_fxp.c,v 1.2 1997/06/05 02:01:55 thorpej Exp $ */
/*
@@ -198,9 +198,6 @@ struct fxp_supported_media {
static int fxp_mediachange __P((struct ifnet *));
static void fxp_mediastatus __P((struct ifnet *, struct ifmediareq *));
-#if 0
-static const char *fxp_phyname __P((int));
-#endif
static inline void fxp_scb_wait __P((struct fxp_softc *));
static FXP_INTR_TYPE fxp_intr __P((void *));
static void fxp_start __P((struct ifnet *));
@@ -435,14 +432,11 @@ fxp_attach(parent, self, aux)
printf(FXP_FORMAT ": no phy found, using auto mode\n",
FXP_ARGS(sc));
}
- ifmedia_set(&sc->sc_mii.mii_media, IFM_ETHER|IFM_AUTO);
-#if 0
- printf(FXP_FORMAT ": %s (%s) address %s\n", FXP_ARGS(sc),
- fxp_phyname(sc->phy_primary_device),
- sc->phy_10Mbps_only ? "10Mbps" : "10/100Mbps",
- ether_sprintf(sc->arpcom.ac_enaddr));
-#endif
+ if (ifmedia_match(&sc->sc_mii.mii_media, IFM_ETHER|IFM_AUTO, 0))
+ ifmedia_set(&sc->sc_mii.mii_media, IFM_ETHER|IFM_AUTO);
+ else
+ ifmedia_set(&sc->sc_mii.mii_media, IFM_ETHER|IFM_10_T);
/*
* Attach the interface.
@@ -481,22 +475,6 @@ fxp_attach(parent, self, aux)
powerhook_establish(fxp_power, sc);
}
-#if 0
-static const char *
-fxp_phyname(device)
- int device;
-{
- static const char * const phynames[] = { "unknown", "82553A",
- "82553C", "82503", "DP83840", "80C240", "80C24",
- "82555/82558/82558B", "unknown", "unknown",
- "DP83840A", "82555B" };
-
- if ((device < FXP_PHY_NONE) || (device > FXP_PHY_82555B))
- return(phynames[0]);
- return(phynames[device]);
-}
-#endif
-
/*
* Device shutdown routine. Called at system shutdown after sync. The
* main purpose of this routine is to shut off receiver DMA so that