get mxge to build, stage 14/many
authorAggelos Economopoulos <aoiko@cc.ece.ntua.gr>
Sun, 5 Jul 2009 12:32:56 +0000 (15:32 +0300)
committerAggelos Economopoulos <aoiko@cc.ece.ntua.gr>
Wed, 8 Jul 2009 20:27:36 +0000 (23:27 +0300)
- have sc->ifp point to sc->arpcom.ac_if
- fix last link state change code

sys/dev/netif/mxge/if_mxge.c
sys/dev/netif/mxge/if_mxge_var.h

index 68a9dfc..8d6da4d 100644 (file)
@@ -2962,7 +2962,8 @@ mxge_intr(void *arg)
                if (stats->link_down) {
                        sc->down_cnt += stats->link_down;
                        sc->link_state = 0;
-                       if_link_state_change(sc->ifp, LINK_STATE_DOWN);
+                       sc->ifp->if_link_state = LINK_STATE_DOWN;
+                       if_link_state_change(sc->ifp);
                }
        }
 
@@ -4454,6 +4455,11 @@ mxge_attach(device_t dev)
        struct ifnet *ifp = &sc->arpcom.ac_if;
        int err, rid;
 
+       /*
+        * avoid rewriting half the lines in this file to use
+        * &sc->arpcom.ac_if instead
+        */
+       sc->ifp = ifp;
        sc->dev = dev;
        mxge_fetch_tunables(sc);
 
index bc4759c..5dfae49 100644 (file)
@@ -213,7 +213,7 @@ struct mxge_slice_state {
 
 struct mxge_softc {
        struct arpcom arpcom;
-       struct ifnet* ifp;
+       struct ifnet* ifp;              /* points to arpcom.ac_if */
        struct mxge_slice_state *ss;
        int csum_flag;                  /* rx_csums?            */
        int tx_boundary;                /* boundary transmits cannot cross*/