aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/etherswitch/arswitch
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/etherswitch/arswitch')
-rw-r--r--sys/dev/etherswitch/arswitch/arswitch.c26
-rw-r--r--sys/dev/etherswitch/arswitch/arswitchvar.h2
2 files changed, 14 insertions, 14 deletions
diff --git a/sys/dev/etherswitch/arswitch/arswitch.c b/sys/dev/etherswitch/arswitch/arswitch.c
index 04d1d9143075..1f3d05611f0f 100644
--- a/sys/dev/etherswitch/arswitch/arswitch.c
+++ b/sys/dev/etherswitch/arswitch/arswitch.c
@@ -85,8 +85,8 @@ static int led_pattern_table[] = {
static inline int arswitch_portforphy(int phy);
static void arswitch_tick(void *arg);
-static int arswitch_ifmedia_upd(struct ifnet *);
-static void arswitch_ifmedia_sts(struct ifnet *, struct ifmediareq *);
+static int arswitch_ifmedia_upd(if_t );
+static void arswitch_ifmedia_sts(if_t , struct ifmediareq *);
static int ar8xxx_port_vlan_setup(struct arswitch_softc *sc,
etherswitch_port_t *p);
static int ar8xxx_port_vlan_get(struct arswitch_softc *sc,
@@ -183,9 +183,9 @@ arswitch_attach_phys(struct arswitch_softc *sc)
break;
}
- sc->ifp[phy]->if_softc = sc;
- sc->ifp[phy]->if_flags |= IFF_UP | IFF_BROADCAST |
- IFF_DRV_RUNNING | IFF_SIMPLEX;
+ if_setsoftc(sc->ifp[phy], sc);
+ if_setflagbits(sc->ifp[phy], IFF_UP | IFF_BROADCAST |
+ IFF_DRV_RUNNING | IFF_SIMPLEX, 0);
sc->ifname[phy] = malloc(strlen(name)+1, M_DEVBUF, M_WAITOK);
bcopy(name, sc->ifname[phy], strlen(name)+1);
if_initname(sc->ifp[phy], sc->ifname[phy],
@@ -748,7 +748,7 @@ arswitch_miiforport(struct arswitch_softc *sc, int port)
return (device_get_softc(sc->miibus[phy]));
}
-static inline struct ifnet *
+static inline if_t
arswitch_ifpforport(struct arswitch_softc *sc, int port)
{
int phy = port-1;
@@ -1052,7 +1052,7 @@ arswitch_setport(device_t dev, etherswitch_port_t *p)
struct arswitch_softc *sc;
struct ifmedia *ifm;
struct mii_data *mii;
- struct ifnet *ifp;
+ if_t ifp;
sc = device_get_softc(dev);
if (p->es_port < 0 || p->es_port > sc->info.es_nports)
@@ -1122,10 +1122,10 @@ arswitch_statchg(device_t dev)
}
static int
-arswitch_ifmedia_upd(struct ifnet *ifp)
+arswitch_ifmedia_upd(if_t ifp)
{
- struct arswitch_softc *sc = ifp->if_softc;
- struct mii_data *mii = arswitch_miiforport(sc, ifp->if_dunit);
+ struct arswitch_softc *sc = if_getsoftc(ifp);
+ struct mii_data *mii = arswitch_miiforport(sc, if_getdunit(ifp));
if (mii == NULL)
return (ENXIO);
@@ -1134,10 +1134,10 @@ arswitch_ifmedia_upd(struct ifnet *ifp)
}
static void
-arswitch_ifmedia_sts(struct ifnet *ifp, struct ifmediareq *ifmr)
+arswitch_ifmedia_sts(if_t ifp, struct ifmediareq *ifmr)
{
- struct arswitch_softc *sc = ifp->if_softc;
- struct mii_data *mii = arswitch_miiforport(sc, ifp->if_dunit);
+ struct arswitch_softc *sc = if_getsoftc(ifp);
+ struct mii_data *mii = arswitch_miiforport(sc, if_getdunit(ifp));
DPRINTF(sc, ARSWITCH_DBG_POLL, "%s\n", __func__);
diff --git a/sys/dev/etherswitch/arswitch/arswitchvar.h b/sys/dev/etherswitch/arswitch/arswitchvar.h
index ff92536358ac..5e628e9243ff 100644
--- a/sys/dev/etherswitch/arswitch/arswitchvar.h
+++ b/sys/dev/etherswitch/arswitch/arswitchvar.h
@@ -76,7 +76,7 @@ struct arswitch_softc {
/* should be the max of both pre-AR8327 and AR8327 ports */
char *ifname[ARSWITCH_NUM_PHYS];
device_t miibus[ARSWITCH_NUM_PHYS];
- struct ifnet *ifp[ARSWITCH_NUM_PHYS];
+ if_t ifp[ARSWITCH_NUM_PHYS];
struct arswitch_dev_led dev_led[ARSWITCH_NUM_PHYS][ARSWITCH_NUM_LEDS];
struct callout callout_tick;
etherswitch_info_t info;