diff options
author | Stefan Sperling <stsp@cvs.openbsd.org> | 2015-09-11 13:02:29 +0000 |
---|---|---|
committer | Stefan Sperling <stsp@cvs.openbsd.org> | 2015-09-11 13:02:29 +0000 |
commit | 60446fe20a75a96e4e90d49e026768a4a5de327e (patch) | |
tree | 4df36879019283b812826de0f68df84379613b0f /sys/dev/sbus | |
parent | 39d4e265d62cc7fb7ea6c2dfa113f7e47cb3a730 (diff) |
Make room for media types of the future. Extend the ifmedia word to 64 bits.
This changes numbers of the SIOCSIFMEDIA and SIOCGIFMEDIA ioctls and
grows struct ifmediareq.
Old ifconfig and dhclient binaries can still assign addresses, however
the 'media' subcommand stops working. Recompiling ifconfig and dhclient
with new headers before a reboot should not be necessary unless in very
special circumstances where non-default media settings must be used to
get link and console access is not available.
There may be some MD fallout but that will be cleared up later.
ok deraadt miod
with help and suggestions from several sharks attending l2k15
Diffstat (limited to 'sys/dev/sbus')
-rw-r--r-- | sys/dev/sbus/be.c | 14 | ||||
-rw-r--r-- | sys/dev/sbus/if_le.c | 4 | ||||
-rw-r--r-- | sys/dev/sbus/if_le_lebuffer.c | 4 | ||||
-rw-r--r-- | sys/dev/sbus/if_le_ledma.c | 4 | ||||
-rw-r--r-- | sys/dev/sbus/qe.c | 4 |
5 files changed, 15 insertions, 15 deletions
diff --git a/sys/dev/sbus/be.c b/sys/dev/sbus/be.c index 3bfd201531d..1d9572e96e6 100644 --- a/sys/dev/sbus/be.c +++ b/sys/dev/sbus/be.c @@ -1,4 +1,4 @@ -/* $OpenBSD: be.c,v 1.32 2015/07/08 07:21:50 mpi Exp $ */ +/* $OpenBSD: be.c,v 1.33 2015/09/11 13:02:28 stsp Exp $ */ /* $NetBSD: be.c,v 1.26 2001/03/20 15:39:20 pk Exp $ */ /*- @@ -210,7 +210,7 @@ beattach(struct device *parent, struct device *self, void *aux) bus_dma_tag_t dmatag = sa->sa_dmatag; bus_dma_segment_t seg; bus_size_t size; - int instance; + uint64_t instance; int rseg, error; u_int32_t v; extern void myetheraddr(u_char *); @@ -371,7 +371,7 @@ beattach(struct device *parent, struct device *self, void *aux) if (child->mii_phy != BE_PHY_EXTERNAL || child->mii_inst > 0) { printf("%s: cannot accommodate MII device %s" - " at phy %d, instance %d\n", + " at phy %d, instance %lld\n", sc->sc_dev.dv_xname, child->mii_dev.dv_xname, child->mii_phy, child->mii_inst); @@ -1335,13 +1335,13 @@ be_mii_statchg(struct device *self) struct be_softc *sc = (struct be_softc *)self; bus_space_tag_t t = sc->sc_bustag; bus_space_handle_t br = sc->sc_br; - u_int instance; + u_int64_t instance; u_int32_t v; instance = IFM_INST(sc->sc_mii.mii_media.ifm_cur->ifm_media); #ifdef DIAGNOSTIC if (instance > 1) - panic("be_mii_statchg: instance %d out of range", instance); + panic("be_mii_statchg: instance %lld out of range", instance); #endif /* Update duplex mode in TX configuration */ @@ -1550,7 +1550,7 @@ void be_intphy_status(struct be_softc *sc) { struct mii_data *mii = &sc->sc_mii; - int media_active, media_status; + uint64_t media_active, media_status; int bmcr, bmsr; media_status = IFM_AVALID; @@ -1580,7 +1580,7 @@ be_intphy_status(struct be_softc *sc) bmsr = be_mii_readreg((struct device *)sc, BE_PHY_INTERNAL, MII_BMSR)| be_mii_readreg((struct device *)sc, BE_PHY_INTERNAL, MII_BMSR); if (bmsr & BMSR_LINK) - media_status |= IFM_ACTIVE; + media_status |= IFM_ACTIVE; mii->mii_media_status = media_status; mii->mii_media_active = media_active; diff --git a/sys/dev/sbus/if_le.c b/sys/dev/sbus/if_le.c index 5053db7f0f3..a6ba3a4b557 100644 --- a/sys/dev/sbus/if_le.c +++ b/sys/dev/sbus/if_le.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_le.c,v 1.16 2014/12/22 02:28:52 tedu Exp $ */ +/* $OpenBSD: if_le.c,v 1.17 2015/09/11 13:02:28 stsp Exp $ */ /* $NetBSD: if_le.c,v 1.17 2001/05/30 11:46:35 mrg Exp $ */ /*- @@ -81,7 +81,7 @@ void leattach_sbus(struct device *, struct device *, void *); /* * Media types supported. */ -static int lemedia[] = { +static uint64_t lemedia[] = { IFM_ETHER | IFM_10_5 }; diff --git a/sys/dev/sbus/if_le_lebuffer.c b/sys/dev/sbus/if_le_lebuffer.c index b899138024b..5900e3e6d08 100644 --- a/sys/dev/sbus/if_le_lebuffer.c +++ b/sys/dev/sbus/if_le_lebuffer.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_le_lebuffer.c,v 1.12 2014/12/22 02:28:52 tedu Exp $ */ +/* $OpenBSD: if_le_lebuffer.c,v 1.13 2015/09/11 13:02:28 stsp Exp $ */ /* $NetBSD: if_le_lebuffer.c,v 1.10 2002/03/11 16:00:56 pk Exp $ */ /*- @@ -79,7 +79,7 @@ void leattach_lebuffer(struct device *, struct device *, void *); /* * Media types supported. */ -static int lemedia[] = { +static uint64_t lemedia[] = { IFM_ETHER | IFM_10_T }; diff --git a/sys/dev/sbus/if_le_ledma.c b/sys/dev/sbus/if_le_ledma.c index 7c0c640fcac..62d2703eb3e 100644 --- a/sys/dev/sbus/if_le_ledma.c +++ b/sys/dev/sbus/if_le_ledma.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_le_ledma.c,v 1.18 2014/12/22 02:28:52 tedu Exp $ */ +/* $OpenBSD: if_le_ledma.c,v 1.19 2015/09/11 13:02:28 stsp Exp $ */ /* $NetBSD: if_le_ledma.c,v 1.14 2001/05/30 11:46:35 mrg Exp $ */ /*- @@ -85,7 +85,7 @@ void leattach_ledma(struct device *, struct device *, void *); /* * Media types supported by the Sun4m. */ -static int lemedia[] = { +static uint64_t lemedia[] = { IFM_ETHER | IFM_10_T, IFM_ETHER | IFM_10_5, IFM_ETHER | IFM_AUTO diff --git a/sys/dev/sbus/qe.c b/sys/dev/sbus/qe.c index a6e375927b7..45426eb421e 100644 --- a/sys/dev/sbus/qe.c +++ b/sys/dev/sbus/qe.c @@ -1,4 +1,4 @@ -/* $OpenBSD: qe.c,v 1.30 2015/07/08 07:21:50 mpi Exp $ */ +/* $OpenBSD: qe.c,v 1.31 2015/09/11 13:02:28 stsp Exp $ */ /* $NetBSD: qe.c,v 1.16 2001/03/30 17:30:18 christos Exp $ */ /*- @@ -1156,7 +1156,7 @@ qe_ifmedia_upd(ifp) struct ifnet *ifp; { struct qe_softc *sc = ifp->if_softc; - int media = sc->sc_ifmedia.ifm_media; + uint64_t media = sc->sc_ifmedia.ifm_media; if (IFM_TYPE(media) != IFM_ETHER) return (EINVAL); |