Commit 2e6a8c1a authored by Justin Hibbits's avatar Justin Hibbits
Browse files

Mechanically convert etherswitch drivers to IfAPI

Reviewed by:	kd
Sponsored by:	Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D37813
parent d8096b2d
......@@ -627,7 +627,7 @@ ar40xx_setport(device_t dev, etherswitch_port_t *p)
struct ar40xx_softc *sc = device_get_softc(dev);
struct ifmedia *ifm;
struct mii_data *mii;
struct ifnet *ifp;
if_t ifp;
int ret;
if (p->es_port < 0 || p->es_port > sc->sc_info.es_nports)
......
......@@ -147,7 +147,7 @@ ar40xx_phy_miiforport(struct ar40xx_softc *sc, int port)
return (device_get_softc(sc->sc_phys.miibus[phy]));
}
struct ifnet *
if_t
ar40xx_phy_ifpforport(struct ar40xx_softc *sc, int port)
{
int phy;
......@@ -159,13 +159,13 @@ ar40xx_phy_ifpforport(struct ar40xx_softc *sc, int port)
}
static int
ar40xx_ifmedia_upd(struct ifnet *ifp)
ar40xx_ifmedia_upd(if_t ifp)
{
struct ar40xx_softc *sc = ifp->if_softc;
struct mii_data *mii = ar40xx_phy_miiforport(sc, ifp->if_dunit);
struct ar40xx_softc *sc = if_getsoftc(ifp);
struct mii_data *mii = ar40xx_phy_miiforport(sc, ifp->if_dunit); /* XXX - DRVAPI */
AR40XX_DPRINTF(sc, AR40XX_DBG_PORT_STATUS, "%s: called, PHY %d\n",
__func__, ifp->if_dunit);
__func__, ifp->if_dunit); /* XXX - DRVAPI */
if (mii == NULL)
return (ENXIO);
......@@ -174,13 +174,13 @@ ar40xx_ifmedia_upd(struct ifnet *ifp)
}
static void
ar40xx_ifmedia_sts(struct ifnet *ifp, struct ifmediareq *ifmr)
ar40xx_ifmedia_sts(if_t ifp, struct ifmediareq *ifmr)
{
struct ar40xx_softc *sc = ifp->if_softc;
struct mii_data *mii = ar40xx_phy_miiforport(sc, ifp->if_dunit);
struct ar40xx_softc *sc = if_getsoftc(ifp);
struct mii_data *mii = ar40xx_phy_miiforport(sc, ifp->if_dunit); /* XXX - DRVAPI */
AR40XX_DPRINTF(sc, AR40XX_DBG_PORT_STATUS, "%s: called, PHY %d\n",
__func__, ifp->if_dunit);
__func__, ifp->if_dunit); /* XXX - DRVAPI */
if (mii == NULL)
return;
......
......@@ -32,7 +32,7 @@ extern int ar40xx_attach_phys(struct ar40xx_softc *sc);
extern int ar40xx_hw_phy_get_ids(struct ar40xx_softc *sc);
extern struct mii_data * ar40xx_phy_miiforport(struct ar40xx_softc *sc,
int port);
extern struct ifnet * ar40xx_phy_ifpforport(struct ar40xx_softc *sc,
extern if_t ar40xx_phy_ifpforport(struct ar40xx_softc *sc,
int port);
#endif /* __AR40XX_PHY_H__ */
......
......@@ -120,7 +120,7 @@ struct ar40xx_softc {
struct {
char *ifname[AR40XX_NUM_PHYS];
device_t miibus[AR40XX_NUM_PHYS];
struct ifnet *ifp[AR40XX_NUM_PHYS];
if_t ifp[AR40XX_NUM_PHYS];
} sc_phys;
/* ATU (address table unit) support */
......
......@@ -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__);
......
......@@ -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;
......
......@@ -77,7 +77,7 @@ typedef struct e6000sw_softc {
phandle_t node;
struct sx sx;
struct ifnet *ifp[E6000SW_MAX_PORTS];
if_t ifp[E6000SW_MAX_PORTS];
char *ifname[E6000SW_MAX_PORTS];
device_t miibus[E6000SW_MAX_PORTS];
struct taskqueue *sc_tq;
......@@ -136,8 +136,8 @@ static int e6000sw_vtu_flush(e6000sw_softc_t *);
static int e6000sw_vtu_update(e6000sw_softc_t *, int, int, int, int, int);
static __inline void e6000sw_writereg(e6000sw_softc_t *, int, int, int);
static __inline uint32_t e6000sw_readreg(e6000sw_softc_t *, int, int);
static int e6000sw_ifmedia_upd(struct ifnet *);
static void e6000sw_ifmedia_sts(struct ifnet *, struct ifmediareq *);
static int e6000sw_ifmedia_upd(if_t );
static void e6000sw_ifmedia_sts(if_t , struct ifmediareq *);
static int e6000sw_atu_mac_table(device_t, e6000sw_softc_t *, struct atu_opt *,
int);
static int e6000sw_get_pvid(e6000sw_softc_t *, int, int *);
......@@ -368,9 +368,9 @@ e6000sw_init_interface(e6000sw_softc_t *sc, int port)
sc->ifp[port] = if_alloc(IFT_ETHER);
if (sc->ifp[port] == NULL)
return (ENOMEM);
sc->ifp[port]->if_softc = sc;
sc->ifp[port]->if_flags |= IFF_UP | IFF_BROADCAST |
IFF_DRV_RUNNING | IFF_SIMPLEX;
if_setsoftc(sc->ifp[port], sc);
if_setflagbits(sc->ifp[port], IFF_UP | IFF_BROADCAST |
IFF_DRV_RUNNING | IFF_SIMPLEX, 0);
sc->ifname[port] = malloc(strlen(name) + 1, M_E6000SW, M_NOWAIT);
if (sc->ifname[port] == NULL) {
if_free(sc->ifp[port]);
......@@ -1280,13 +1280,13 @@ e6000sw_miiforphy(e6000sw_softc_t *sc, unsigned int phy)
}
static int
e6000sw_ifmedia_upd(struct ifnet *ifp)
e6000sw_ifmedia_upd(if_t ifp)
{
e6000sw_softc_t *sc;
struct mii_data *mii;
sc = ifp->if_softc;
mii = e6000sw_miiforphy(sc, ifp->if_dunit);
sc = if_getsoftc(ifp);
mii = e6000sw_miiforphy(sc, if_getdunit(ifp));
if (mii == NULL)
return (ENXIO);
mii_mediachg(mii);
......@@ -1295,13 +1295,13 @@ e6000sw_ifmedia_upd(struct ifnet *ifp)
}
static void
e6000sw_ifmedia_sts(struct ifnet *ifp, struct ifmediareq *ifmr)
e6000sw_ifmedia_sts(if_t ifp, struct ifmediareq *ifmr)
{
e6000sw_softc_t *sc;
struct mii_data *mii;
sc = ifp->if_softc;
mii = e6000sw_miiforphy(sc, ifp->if_dunit);
sc = if_getsoftc(ifp);
mii = e6000sw_miiforphy(sc, if_getdunit(ifp));
if (mii == NULL)
return;
......
......@@ -120,7 +120,7 @@ struct e6060sw_softc {
int *portphy;
char **ifname;
device_t **miibus;
struct ifnet **ifp;
if_t *ifp;
struct callout callout_tick;
etherswitch_info_t info;
int smi_offset;
......@@ -150,8 +150,8 @@ struct e6060sw_softc {
static inline int e6060sw_portforphy(struct e6060sw_softc *, int);
static void e6060sw_tick(void *);
static int e6060sw_ifmedia_upd(struct ifnet *);
static void e6060sw_ifmedia_sts(struct ifnet *, struct ifmediareq *);
static int e6060sw_ifmedia_upd(if_t );
static void e6060sw_ifmedia_sts(if_t , struct ifmediareq *);
static void e6060sw_setup(device_t dev);
static int e6060sw_read_vtu(device_t dev, int num, int *data1, int *data2);
......@@ -300,7 +300,7 @@ e6060sw_attach(device_t dev)
e6060sw_setup(dev);
sc->ifp = malloc(sizeof(struct ifnet *) * sc->numports, M_E6060SW,
sc->ifp = malloc(sizeof(if_t ) * sc->numports, M_E6060SW,
M_WAITOK | M_ZERO);
sc->ifname = malloc(sizeof(char *) * sc->numports, M_E6060SW,
M_WAITOK | M_ZERO);
......@@ -383,7 +383,7 @@ e6060sw_miiforport(struct e6060sw_softc *sc, int port)
return (device_get_softc(*sc->miibus[port]));
}
static inline struct ifnet *
static inline if_t
e6060sw_ifpforport(struct e6060sw_softc *sc, int port)
{
......@@ -516,7 +516,7 @@ e6060sw_setport(device_t dev, etherswitch_port_t *p)
struct e6060sw_softc *sc;
struct ifmedia *ifm;
struct mii_data *mii;
struct ifnet *ifp;
if_t ifp;
int err;
int data;
......@@ -883,13 +883,13 @@ e6060sw_statchg(device_t dev)
}
static int
e6060sw_ifmedia_upd(struct ifnet *ifp)
e6060sw_ifmedia_upd(if_t ifp)
{
struct e6060sw_softc *sc;
struct mii_data *mii;
sc = ifp->if_softc;
mii = e6060sw_miiforport(sc, ifp->if_dunit);
sc = if_getsoftc(ifp);
mii = e6060sw_miiforport(sc, ifp->if_dunit); /* XXX - DRVAPI */
DPRINTF(sc->sc_dev, "%s\n", __func__);
if (mii == NULL)
......@@ -899,13 +899,13 @@ e6060sw_ifmedia_upd(struct ifnet *ifp)
}
static void
e6060sw_ifmedia_sts(struct ifnet *ifp, struct ifmediareq *ifmr)
e6060sw_ifmedia_sts(if_t ifp, struct ifmediareq *ifmr)
{
struct e6060sw_softc *sc;
struct mii_data *mii;
sc = ifp->if_softc;
mii = e6060sw_miiforport(sc, ifp->if_dunit);
sc = if_getsoftc(ifp);
mii = e6060sw_miiforport(sc, ifp->if_dunit); /* XXX - DRVAPI */
DPRINTF(sc->sc_dev, "%s\n", __func__);
......
......@@ -88,8 +88,8 @@ static int felix_setup(felix_softc_t);
static void felix_setup_port(felix_softc_t, int);
static void felix_tick(void *);
static int felix_ifmedia_upd(struct ifnet *);
static void felix_ifmedia_sts(struct ifnet *, struct ifmediareq *);
static int felix_ifmedia_upd(if_t );
static void felix_ifmedia_sts(if_t , struct ifmediareq *);
static void felix_get_port_cfg(felix_softc_t, etherswitch_port_t *);
static void felix_set_port_cfg(felix_softc_t, etherswitch_port_t *);
......@@ -246,9 +246,9 @@ felix_init_interface(felix_softc_t sc, int port)
if (sc->ports[port].ifp == NULL)
return (ENOMEM);
sc->ports[port].ifp->if_softc = sc;
sc->ports[port].ifp->if_flags = IFF_UP | IFF_BROADCAST | IFF_MULTICAST |
IFF_DRV_RUNNING | IFF_SIMPLEX;
if_setsoftc(sc->ports[port].ifp, sc);
if_setflags(sc->ports[port].ifp, IFF_UP | IFF_BROADCAST | IFF_MULTICAST |
IFF_DRV_RUNNING | IFF_SIMPLEX);
sc->ports[port].ifname = malloc(strlen(name) + 1, M_FELIX, M_NOWAIT);
if (sc->ports[port].ifname == NULL) {
if_free(sc->ports[port].ifp);
......@@ -964,13 +964,13 @@ felix_tick(void *arg)
}
static int
felix_ifmedia_upd(struct ifnet *ifp)
felix_ifmedia_upd(if_t ifp)
{
struct mii_data *mii;
felix_softc_t sc;
sc = ifp->if_softc;
mii = felix_miiforport(sc, ifp->if_dunit);
sc = if_getsoftc(ifp);
mii = felix_miiforport(sc, ifp->if_dunit); /* XXX - DRVAPI */
if (mii == NULL)
return (ENXIO);
......@@ -979,13 +979,13 @@ felix_ifmedia_upd(struct ifnet *ifp)
}
static void
felix_ifmedia_sts(struct ifnet *ifp, struct ifmediareq *ifmr)
felix_ifmedia_sts(if_t ifp, struct ifmediareq *ifmr)
{
felix_softc_t sc;
struct mii_data *mii;
sc = ifp->if_softc;
mii = felix_miiforport(sc, ifp->if_dunit);
sc = if_getsoftc(ifp);
mii = felix_miiforport(sc, ifp->if_dunit); /* XXX - DRVAPI */
if (mii == NULL)
return;
......
......@@ -79,7 +79,7 @@ struct felix_pci_id {
};
struct felix_port {
struct ifnet *ifp;
if_t ifp;
device_t miibus;
char *ifname;
......
......@@ -100,7 +100,7 @@ struct adm6996fc_softc {
int *portphy;
char **ifname;
device_t **miibus;
struct ifnet **ifp;
if_t *ifp;
struct callout callout_tick;
etherswitch_info_t info;
};
......@@ -122,8 +122,8 @@ struct adm6996fc_softc {
static inline int adm6996fc_portforphy(struct adm6996fc_softc *, int);
static void adm6996fc_tick(void *);
static int adm6996fc_ifmedia_upd(struct ifnet *);
static void adm6996fc_ifmedia_sts(struct ifnet *, struct ifmediareq *);
static int adm6996fc_ifmedia_upd(if_t );
static void adm6996fc_ifmedia_sts(if_t , struct ifmediareq *);
#define ADM6996FC_READREG(dev, x) \
MDIO_READREG(dev, ((x) >> 5), ((x) & 0x1f));
......@@ -254,7 +254,7 @@ adm6996fc_attach(device_t dev)
sc->info.es_nvlangroups = 16;
sc->info.es_vlan_caps = ETHERSWITCH_VLAN_PORT | ETHERSWITCH_VLAN_DOT1Q;
sc->ifp = malloc(sizeof(struct ifnet *) * sc->numports, M_ADM6996FC,
sc->ifp = malloc(sizeof(if_t ) * sc->numports, M_ADM6996FC,
M_WAITOK | M_ZERO);
sc->ifname = malloc(sizeof(char *) * sc->numports, M_ADM6996FC,
M_WAITOK | M_ZERO);
......@@ -355,7 +355,7 @@ adm6996fc_miiforport(struct adm6996fc_softc *sc, int port)
return (device_get_softc(*sc->miibus[port]));
}
static inline struct ifnet *
static inline if_t
adm6996fc_ifpforport(struct adm6996fc_softc *sc, int port)
{
......@@ -504,7 +504,7 @@ adm6996fc_setport(device_t dev, etherswitch_port_t *p)
struct adm6996fc_softc *sc;
struct ifmedia *ifm;
struct mii_data *mii;
struct ifnet *ifp;
if_t ifp;
device_t parent;
int err;
int data;
......@@ -721,13 +721,13 @@ adm6996fc_statchg(device_t dev)
}
static int
adm6996fc_ifmedia_upd(struct ifnet *ifp)
adm6996fc_ifmedia_upd(if_t ifp)
{
struct adm6996fc_softc *sc;
struct mii_data *mii;
sc = ifp->if_softc;
mii = adm6996fc_miiforport(sc, ifp->if_dunit);
sc = if_getsoftc(ifp);
mii = adm6996fc_miiforport(sc, ifp->if_dunit); /* XXX - DRVAPI */
DPRINTF(sc->sc_dev, "%s\n", __func__);
if (mii == NULL)
......@@ -737,13 +737,13 @@ adm6996fc_ifmedia_upd(struct ifnet *ifp)
}
static void
adm6996fc_ifmedia_sts(struct ifnet *ifp, struct ifmediareq *ifmr)
adm6996fc_ifmedia_sts(if_t ifp, struct ifmediareq *ifmr)
{
struct adm6996fc_softc *sc;
struct mii_data *mii;
sc = ifp->if_softc;
mii = adm6996fc_miiforport(sc, ifp->if_dunit);
sc = if_getsoftc(ifp);
mii = adm6996fc_miiforport(sc, ifp->if_dunit); /* XXX - DRVAPI */
DPRINTF(sc->sc_dev, "%s\n", __func__);
......
......@@ -79,8 +79,8 @@ MALLOC_DECLARE(M_IP17X);
MALLOC_DEFINE(M_IP17X, "ip17x", "ip17x data structures");
static void ip17x_tick(void *);
static int ip17x_ifmedia_upd(struct ifnet *);
static void ip17x_ifmedia_sts(struct ifnet *, struct ifmediareq *);
static int ip17x_ifmedia_upd(if_t );
static void ip17x_ifmedia_sts(if_t , struct ifmediareq *);
static void
ip17x_identify(driver_t *driver, device_t parent)
......@@ -180,9 +180,9 @@ ip17x_attach_phys(struct ip17x_softc *sc)
break;
}
sc->ifp[port]->if_softc = sc;
sc->ifp[port]->if_flags |= IFF_UP | IFF_BROADCAST |
IFF_DRV_RUNNING | IFF_SIMPLEX;
if_setsoftc(sc->ifp[port], sc);
if_setflags(sc->ifp[port], IFF_UP | IFF_BROADCAST |
IFF_DRV_RUNNING | IFF_SIMPLEX);
if_initname(sc->ifp[port], name, port);
sc->miibus[port] = malloc(sizeof(device_t), M_IP17X,
M_WAITOK | M_ZERO);
......@@ -191,7 +191,7 @@ ip17x_attach_phys(struct ip17x_softc *sc)
BMSR_DEFCAPMASK, phy, MII_OFFSET_ANY, 0);
DPRINTF(sc->sc_dev, "%s attached to pseudo interface %s\n",
device_get_nameunit(*sc->miibus[port]),
sc->ifp[port]->if_xname);
if_name(sc->ifp[port]));
if (err != 0) {
device_printf(sc->sc_dev,
"attaching PHY %d failed\n",
......@@ -240,7 +240,7 @@ ip17x_attach(device_t dev)
/* Always attach the cpu port. */
sc->phymask |= (1 << sc->cpuport);
sc->ifp = malloc(sizeof(struct ifnet *) * sc->numports, M_IP17X,
sc->ifp = malloc(sizeof(if_t ) * sc->numports, M_IP17X,
M_WAITOK | M_ZERO);
sc->pvid = malloc(sizeof(uint32_t) * sc->numports, M_IP17X,
M_WAITOK | M_ZERO);
......@@ -324,7 +324,7 @@ ip17x_miiforport(struct ip17x_softc *sc, int port)
return (device_get_softc(*sc->miibus[port]));
}
static inline struct ifnet *
static inline if_t
ip17x_ifpforport(struct ip17x_softc *sc, int port)
{
......@@ -459,7 +459,7 @@ ip17x_setport(device_t dev, etherswitch_port_t *p)
{
struct ip17x_softc *sc;
struct ifmedia *ifm;
struct ifnet *ifp;
if_t ifp;
struct mii_data *mii;
int phy;
......@@ -524,14 +524,14 @@ ip17x_statchg(device_t dev)
}
static int
ip17x_ifmedia_upd(struct ifnet *ifp)
ip17x_ifmedia_upd(if_t ifp)
{
struct ip17x_softc *sc;
struct mii_data *mii;
sc = ifp->if_softc;
sc = if_getsoftc(ifp);
DPRINTF(sc->sc_dev, "%s\n", __func__);
mii = ip17x_miiforport(sc, ifp->if_dunit);
mii = ip17x_miiforport(sc, if_getdunit(ifp));
if (mii == NULL)
return (ENXIO);
mii_mediachg(mii);
......@@ -540,14 +540,14 @@ ip17x_ifmedia_upd(struct ifnet *ifp)
}
static void
ip17x_ifmedia_sts(struct ifnet *ifp, struct ifmediareq *ifmr)
ip17x_ifmedia_sts(if_t ifp, struct ifmediareq *ifmr)
{
struct ip17x_softc *sc;
struct mii_data *mii;
sc = ifp->if_softc;
sc = if_getsoftc(ifp);
DPRINTF(sc->sc_dev, "%s\n", __func__);
mii = ip17x_miiforport(sc, ifp->if_dunit);
mii = ip17x_miiforport(sc, if_getdunit(ifp));
if (mii == NULL)
return;
mii_pollstat(mii);
......
......@@ -59,7 +59,7 @@ struct ip17x_softc {
etherswitch_info_t info;
ip17x_switch_type sc_switchtype;
struct callout callout_tick;
struct ifnet **ifp;
if_t *ifp;
struct mtx sc_mtx; /* serialize access to softc */
struct ip17x_vlan vlan[IP17X_MAX_VLANS];
......
......@@ -151,7 +151,7 @@ struct ksz8995ma_softc {
int *portphy;
char **ifname;
device_t **miibus;
struct ifnet **ifp;
if_t *ifp;
struct callout callout_tick;
etherswitch_info_t info;
};
......@@ -173,8 +173,8 @@ struct ksz8995ma_softc {
static inline int ksz8995ma_portforphy(struct ksz8995ma_softc *, int);
static void ksz8995ma_tick(void *);
static int ksz8995ma_ifmedia_upd(struct ifnet *);
static void ksz8995ma_ifmedia_sts(struct ifnet *, struct ifmediareq *);
static int ksz8995ma_ifmedia_upd(if_t );
static void ksz8995ma_ifmedia_sts(if_t , struct ifmediareq *);
static int ksz8995ma_readreg(device_t dev, int addr);
static int ksz8995ma_writereg(device_t dev, int addr, int value);
static void ksz8995ma_portvlanreset(device_t dev);
......@@ -304,7 +304,7 @@ ksz8995ma_attach(device_t dev)
sc->info.es_nvlangroups = 16;
sc->info.es_vlan_caps = ETHERSWITCH_VLAN_PORT | ETHERSWITCH_VLAN_DOT1Q;
sc->ifp = malloc(sizeof(struct ifnet *) * sc->numports, M_KSZ8995MA,
sc->ifp = malloc(sizeof(if_t ) * sc->numports, M_KSZ8995MA,
M_WAITOK | M_ZERO);
sc->ifname = malloc(sizeof(char *) * sc->numports, M_KSZ8995MA,
M_WAITOK | M_ZERO);
......@@ -413,7 +413,7 @@ ksz8995ma_miiforport(struct ksz8995ma_softc *sc, int port)
return (device_get_softc(*sc->miibus[port]));
}
static inline struct ifnet *
static inline if_t
ksz8995ma_ifpforport(struct ksz8995ma_softc *sc, int port)
{
......@@ -565,7 +565,7 @@ ksz8995ma_setport(device_t dev, etherswitch_port_t *p)
struct ksz8995ma_softc *sc;
struct mii_data *mii;
struct ifmedia *ifm;
struct ifnet *ifp;
if_t ifp;
int phy, err;