Skip to content

Commit

Permalink
igb: Initialize if_name so functions used on if_init could use if_printf
Browse files Browse the repository at this point in the history
  • Loading branch information
Sepherosa Ziehau committed Oct 6, 2012
1 parent 3dc5183 commit 62be589
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions sys/dev/netif/igb/if_igb.c
Expand Up @@ -367,6 +367,8 @@ igb_attach(device_t dev)
callout_init_mp(&sc->timer);
lwkt_serialize_init(&sc->main_serialize);

if_initname(&sc->arpcom.ac_if, device_get_name(dev),
device_get_unit(dev));
sc->dev = sc->osdep.dev = dev;

/*
Expand Down Expand Up @@ -1384,7 +1386,6 @@ igb_setup_ifp(struct igb_softc *sc)
{
struct ifnet *ifp = &sc->arpcom.ac_if;

if_initname(ifp, device_get_name(sc->dev), device_get_unit(sc->dev));
ifp->if_softc = sc;
ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST;
ifp->if_init = igb_init;
Expand Down Expand Up @@ -3705,8 +3706,10 @@ igb_set_intr_mask(struct igb_softc *sc)
sc->intr_mask |= sc->rx_rings[i].rx_intr_mask;
for (i = 0; i < sc->tx_ring_cnt; ++i)
sc->intr_mask |= sc->tx_rings[i].tx_intr_mask;
if (bootverbose)
device_printf(sc->dev, "intr mask 0x%08x\n", sc->intr_mask);
if (bootverbose) {
if_printf(&sc->arpcom.ac_if, "intr mask 0x%08x\n",
sc->intr_mask);
}
}

static int
Expand Down Expand Up @@ -4174,7 +4177,7 @@ igb_set_ring_inuse(struct igb_softc *sc, boolean_t polling)
else
sc->rx_ring_inuse = sc->rx_ring_msix;
if (bootverbose) {
device_printf(sc->dev, "RX rings %d/%d\n",
if_printf(&sc->arpcom.ac_if, "RX rings %d/%d\n",
sc->rx_ring_inuse, sc->rx_ring_cnt);
}
}
Expand Down

0 comments on commit 62be589

Please sign in to comment.