netif: Setup TX ring CPUID before hooking up interrupt vectors
authorSepherosa Ziehau <sephe@dragonflybsd.org>
Mon, 11 Mar 2013 12:33:28 +0000 (20:33 +0800)
committerSepherosa Ziehau <sephe@dragonflybsd.org>
Mon, 11 Mar 2013 12:33:28 +0000 (20:33 +0800)
56 files changed:
sys/dev/netif/acx/if_acx.c
sys/dev/netif/ae/if_ae.c
sys/dev/netif/age/if_age.c
sys/dev/netif/alc/if_alc.c
sys/dev/netif/ale/if_ale.c
sys/dev/netif/an/if_an_isa.c
sys/dev/netif/an/if_an_pccard.c
sys/dev/netif/an/if_an_pci.c
sys/dev/netif/bfe/if_bfe.c
sys/dev/netif/bge/if_bge.c
sys/dev/netif/bnx/if_bnx.c
sys/dev/netif/bwi/if_bwi.c
sys/dev/netif/cs/if_cs.c
sys/dev/netif/dc/if_dc.c
sys/dev/netif/ed/if_ed_isa.c
sys/dev/netif/ed/if_ed_pccard.c
sys/dev/netif/ed/if_ed_pci.c
sys/dev/netif/em/if_em.c
sys/dev/netif/ep/if_ep_isa.c
sys/dev/netif/ep/if_ep_pccard.c
sys/dev/netif/et/if_et.c
sys/dev/netif/ex/if_ex_isa.c
sys/dev/netif/ex/if_ex_pccard.c
sys/dev/netif/fe/if_fe.c
sys/dev/netif/fxp/if_fxp.c
sys/dev/netif/iwl/iwl2100.c
sys/dev/netif/lge/if_lge.c
sys/dev/netif/lnc/if_lnc_isa.c
sys/dev/netif/lnc/if_lnc_pci.c
sys/dev/netif/msk/if_msk.c
sys/dev/netif/my/if_my.c
sys/dev/netif/nfe/if_nfe.c
sys/dev/netif/nge/if_nge.c
sys/dev/netif/pcn/if_pcn.c
sys/dev/netif/re/if_re.c
sys/dev/netif/rl/if_rl.c
sys/dev/netif/rtw/rtw.c
sys/dev/netif/sbni/if_sbni_pci.c
sys/dev/netif/sbsh/if_sbsh.c
sys/dev/netif/sf/if_sf.c
sys/dev/netif/sis/if_sis.c
sys/dev/netif/sk/if_sk.c
sys/dev/netif/sln/if_sln.c
sys/dev/netif/sn/if_sn.c
sys/dev/netif/ste/if_ste.c
sys/dev/netif/stge/if_stge.c
sys/dev/netif/ti/if_ti.c
sys/dev/netif/tl/if_tl.c
sys/dev/netif/tx/if_tx.c
sys/dev/netif/txp/if_txp.c
sys/dev/netif/vge/if_vge.c
sys/dev/netif/vr/if_vr.c
sys/dev/netif/vx/if_vx_pci.c
sys/dev/netif/wb/if_wb.c
sys/dev/netif/xe/if_xe.c
sys/dev/netif/xl/if_xl.c

index e577dcc..1a8c5c6 100644 (file)
@@ -540,6 +540,8 @@ acx_attach(device_t dev)
        sc->sc_rx_th.wr_ihdr.it_len = htole16(sc->sc_rx_th_len);
        sc->sc_rx_th.wr_ihdr.it_present = htole32(ACX_RX_RADIOTAP_PRESENT);
 
+       ifq_set_cpuid(&ifp->if_snd, rman_get_cpuid(sc->sc_irq_res));
+
        error = bus_setup_intr(dev, sc->sc_irq_res, INTR_MPSAFE, acx_intr, sc,
                               &sc->sc_irq_handle, ifp->if_serializer);
        if (error) {
@@ -549,8 +551,6 @@ acx_attach(device_t dev)
                goto fail;
        }
 
-       ifq_set_cpuid(&ifp->if_snd, rman_get_cpuid(sc->sc_irq_res));
-
        if (bootverbose)
                ieee80211_announce(ic);
 
index 14ed240..fdc9009 100644 (file)
@@ -1400,6 +1400,8 @@ ae_attach(device_t dev)
        /* Tell the upper layer(s) we support long frames. */
        ifp->if_data.ifi_hdrlen = sizeof(struct ether_vlan_header);
 
+       ifq_set_cpuid(&ifp->if_snd, rman_get_cpuid(sc->ae_irq_res));
+
        error = bus_setup_intr(dev, sc->ae_irq_res, INTR_MPSAFE, ae_intr, sc,
                               &sc->ae_irq_handle, ifp->if_serializer);
        if (error) {
@@ -1407,7 +1409,6 @@ ae_attach(device_t dev)
                ether_ifdetach(ifp);
                goto fail;
        }
-       ifq_set_cpuid(&ifp->if_snd, rman_get_cpuid(sc->ae_irq_res));
        return 0;
 fail:
        ae_detach(dev);
index e8f0452..bea241f 100644 (file)
@@ -658,6 +658,8 @@ age_attach(device_t dev)
        /* Tell the upper layer(s) we support long frames. */
        ifp->if_data.ifi_hdrlen = sizeof(struct ether_vlan_header);
 
+       ifq_set_cpuid(&ifp->if_snd, rman_get_cpuid(sc->age_irq_res));
+
        error = bus_setup_intr(dev, sc->age_irq_res, INTR_MPSAFE, age_intr, sc,
                               &sc->age_irq_handle, ifp->if_serializer);
        if (error) {
@@ -666,7 +668,6 @@ age_attach(device_t dev)
                goto fail;
        }
 
-       ifq_set_cpuid(&ifp->if_snd, rman_get_cpuid(sc->age_irq_res));
        return 0;
 fail:
        age_detach(dev);
index 27d7a22..329f74c 100644 (file)
@@ -933,6 +933,7 @@ alc_attach(device_t dev)
        /* Tell the upper layer(s) we support long frames. */
        ifp->if_data.ifi_hdrlen = sizeof(struct ether_vlan_header);
 
+       ifq_set_cpuid(&ifp->if_snd, rman_get_cpuid(sc->alc_irq));
 #if 0
        /* Create local taskq. */
        TASK_INIT(&sc->alc_tx_task, 1, alc_tx_task, ifp);
@@ -976,7 +977,6 @@ alc_attach(device_t dev)
                goto fail;
        }
 #endif
-       ifq_set_cpuid(&ifp->if_snd, rman_get_cpuid(sc->alc_irq));
 
 fail:
        if (error != 0)
index e70c1b4..a6d88a4 100644 (file)
@@ -632,6 +632,8 @@ ale_attach(device_t dev)
        /* Tell the upper layer(s) we support long frames. */
        ifp->if_data.ifi_hdrlen = sizeof(struct ether_vlan_header);
 
+       ifq_set_cpuid(&ifp->if_snd, rman_get_cpuid(sc->ale_irq_res));
+
        error = bus_setup_intr(dev, sc->ale_irq_res, INTR_MPSAFE, ale_intr, sc,
                               &sc->ale_irq_handle, ifp->if_serializer);
        if (error) {
@@ -640,7 +642,6 @@ ale_attach(device_t dev)
                goto fail;
        }
 
-       ifq_set_cpuid(&ifp->if_snd, rman_get_cpuid(sc->ale_irq_res));
        return 0;
 fail:
        ale_detach(dev);
index ca2ed34..d5f1b1b 100644 (file)
@@ -117,6 +117,8 @@ an_attach_isa(device_t dev)
        if (error)
                goto fail;
 
+       ifq_set_cpuid(&ifp->if_snd, rman_get_cpuid(sc->irq_res));
+
        error = bus_setup_intr(dev, sc->irq_res, INTR_MPSAFE,
                               an_intr, sc, &sc->irq_handle, 
                               sc->arpcom.ac_if.if_serializer);
@@ -126,8 +128,6 @@ an_attach_isa(device_t dev)
                goto fail;
        }
 
-       ifq_set_cpuid(&ifp->if_snd, rman_get_cpuid(sc->irq_res));
-
        return (0);
 
 fail:
index c78f740..7ed2ddf 100644 (file)
@@ -157,6 +157,8 @@ an_pccard_attach(device_t dev)
        if (error)
                goto fail;
 
+       ifq_set_cpuid(&ifp->if_snd, rman_get_cpuid(sc->irq_res));
+
        /*
         * Must setup the interrupt after the an_attach to prevent racing.
         */
@@ -169,8 +171,6 @@ an_pccard_attach(device_t dev)
                goto fail;
        }
 
-       ifq_set_cpuid(&ifp->if_snd, rman_get_cpuid(sc->irq_res));
-
        return 0;
 
 fail:
index 004c47f..a73a981 100644 (file)
@@ -204,6 +204,8 @@ an_attach_pci(device_t dev)
        if (error)
                goto fail;
 
+       ifq_set_cpuid(&ifp->if_snd, rman_get_cpuid(sc->irq_res));
+
        error = bus_setup_intr(dev, sc->irq_res, INTR_MPSAFE,
                               an_intr, sc, &sc->irq_handle, 
                               sc->arpcom.ac_if.if_serializer);
@@ -213,8 +215,6 @@ an_attach_pci(device_t dev)
                goto fail;
        }
 
-       ifq_set_cpuid(&ifp->if_snd, rman_get_cpuid(sc->irq_res));
-
        return(0);
 
 fail:
index 2b41283..a30dd49 100644 (file)
@@ -413,6 +413,8 @@ bfe_attach(device_t dev)
 
        ether_ifattach(ifp, sc->arpcom.ac_enaddr, NULL);
 
+       ifq_set_cpuid(&ifp->if_snd, rman_get_cpuid(sc->bfe_irq));
+
        /*
         * Hook interrupt last to avoid having to lock softc
         */
@@ -425,8 +427,6 @@ bfe_attach(device_t dev)
                device_printf(dev, "couldn't set up irq\n");
                goto fail;
        }
-
-       ifq_set_cpuid(&ifp->if_snd, rman_get_cpuid(sc->bfe_irq));
        return 0;
 fail:
        bfe_detach(dev);
index c7afa82..c8b754d 100644 (file)
@@ -2556,6 +2556,8 @@ bge_attach(device_t dev)
         */
        ether_ifattach(ifp, ether_addr, NULL);
 
+       ifq_set_cpuid(&ifp->if_snd, rman_get_cpuid(sc->bge_irq));
+
 #ifdef IFPOLL_ENABLE
        /* Polling setup */
        ifpoll_compat_setup(&sc->bge_npoll,
@@ -2584,8 +2586,6 @@ bge_attach(device_t dev)
                goto fail;
        }
 
-       ifq_set_cpuid(&ifp->if_snd, rman_get_cpuid(sc->bge_irq));
-
        return(0);
 fail:
        bge_detach(dev);
index 4768f44..2e07193 100644 (file)
@@ -2192,6 +2192,8 @@ bnx_attach(device_t dev)
         */
        ether_ifattach(ifp, ether_addr, NULL);
 
+       ifq_set_cpuid(&ifp->if_snd, sc->bnx_intr_cpuid);
+
 #ifdef IFPOLL_ENABLE
        ifpoll_compat_setup(&sc->bnx_npoll,
            &sc->bnx_sysctl_ctx, sc->bnx_sysctl_tree,
@@ -2219,7 +2221,6 @@ bnx_attach(device_t dev)
 
        sc->bnx_intr_cpuid = rman_get_cpuid(sc->bnx_irq);
        sc->bnx_stat_cpuid = sc->bnx_intr_cpuid;
-       ifq_set_cpuid(&ifp->if_snd, sc->bnx_intr_cpuid);
 
        return(0);
 fail:
index 8e0aca9..273ded8 100644 (file)
@@ -805,6 +805,8 @@ bwi_attach(device_t dev)
        sc->sc_rx_th.wr_ihdr.it_len = htole16(sc->sc_rx_th_len);
        sc->sc_rx_th.wr_ihdr.it_present = htole32(BWI_RX_RADIOTAP_PRESENT);
 
+       ifq_set_cpuid(&ifp->if_snd, rman_get_cpuid(sc->sc_irq_res));
+
        error = bus_setup_intr(dev, sc->sc_irq_res, INTR_MPSAFE, bwi_intr, sc,
                               &sc->sc_irq_handle, ifp->if_serializer);
        if (error) {
@@ -814,8 +816,6 @@ bwi_attach(device_t dev)
                goto fail;
        }
 
-       ifq_set_cpuid(&ifp->if_snd, rman_get_cpuid(sc->sc_irq_res));
-
        if (bootverbose)
                ieee80211_announce(ic);
 
index 670ae39..e2c79e7 100644 (file)
@@ -682,6 +682,8 @@ cs_attach(device_t dev)
 
        ether_ifattach(ifp, sc->arpcom.ac_enaddr, NULL);
 
+       ifq_set_cpuid(&ifp->if_snd, rman_get_cpuid(sc->irq_res));
+
        error = bus_setup_intr(dev, sc->irq_res, INTR_MPSAFE,
                               csintr, sc, &sc->irq_handle, 
                               ifp->if_serializer);
@@ -691,8 +693,6 @@ cs_attach(device_t dev)
                goto bad;
        }
 
-       ifq_set_cpuid(&ifp->if_snd, rman_get_cpuid(sc->irq_res));
-
        return 0;
 
 bad:
index 313d8de..b245f85 100644 (file)
@@ -2183,6 +2183,8 @@ dc_attach(device_t dev)
         */
        ifp->if_data.ifi_hdrlen = sizeof(struct ether_vlan_header);
 
+       ifq_set_cpuid(&ifp->if_snd, rman_get_cpuid(sc->dc_irq));
+
        error = bus_setup_intr(dev, sc->dc_irq, INTR_MPSAFE,
                               dc_intr, sc, &sc->dc_intrhand, 
                               ifp->if_serializer);
@@ -2192,8 +2194,6 @@ dc_attach(device_t dev)
                goto fail;
        }
 
-       ifq_set_cpuid(&ifp->if_snd, rman_get_cpuid(sc->dc_irq));
-
        return(0);
 
 fail:
index 4ae2bf2..b33b442 100644 (file)
@@ -134,15 +134,13 @@ ed_isa_attach(device_t dev)
        if (error == 0) {
                struct ifnet *ifp = &sc->arpcom.ac_if;
 
+               ifq_set_cpuid(&ifp->if_snd, rman_get_cpuid(sc->irq_res));
+
                error = bus_setup_intr(dev, sc->irq_res, INTR_MPSAFE,
                                       edintr, sc, &sc->irq_handle,
                                       ifp->if_serializer);
-               if (error) {
+               if (error)
                        ed_isa_detach(dev);
-               } else {
-                       ifq_set_cpuid(&ifp->if_snd,
-                           rman_get_cpuid(sc->irq_res));
-               }
        } else {
                ed_release_resources(dev);
        }
index a807b90..61f7bec 100644 (file)
@@ -283,6 +283,8 @@ ed_pccard_attach(device_t dev)
        }
 #endif
 
+       ifq_set_cpuid(&ifp->if_snd, rman_get_cpuid(sc->irq_res));
+
        error = bus_setup_intr(dev, sc->irq_res, INTR_MPSAFE,
                               edintr, sc, &sc->irq_handle,
                               ifp->if_serializer);
@@ -290,8 +292,6 @@ ed_pccard_attach(device_t dev)
                kprintf("setup intr failed %d \n", error);
                ed_release_resources(dev);
                return (error);
-       } else {
-               ifq_set_cpuid(&ifp->if_snd, rman_get_cpuid(sc->irq_res));
        }
 
        return (error);
index 099b7bf..fabb4b1 100644 (file)
@@ -106,15 +106,13 @@ ed_pci_attach(device_t dev)
        if (error == 0) {
                struct ifnet *ifp = &sc->arpcom.ac_if;
 
+               ifq_set_cpuid(&ifp->if_snd, rman_get_cpuid(sc->irq_res));
+
                error = bus_setup_intr(dev, sc->irq_res, INTR_MPSAFE,
                                       edintr, sc, &sc->irq_handle,
                                       ifp->if_serializer);
-               if (error) {
+               if (error)
                        ed_pci_detach(dev);
-               } else {
-                       ifq_set_cpuid(&ifp->if_snd,
-                           rman_get_cpuid(sc->irq_res));
-               }
        } else {
                 ed_release_resources(dev);
        }
index 41b7c60..42dda92 100644 (file)
@@ -845,6 +845,8 @@ em_attach(device_t dev)
            EM_FLAG_HAS_MGMT && adapter->hw.mac.type >= e1000_82571)
                em_get_hw_control(adapter);
 
+       ifq_set_cpuid(&ifp->if_snd, rman_get_cpuid(adapter->intr_res));
+
        /*
         * Missing Interrupt Following ICR read:
         *
@@ -870,8 +872,6 @@ em_attach(device_t dev)
                ether_ifdetach(&adapter->arpcom.ac_if);
                goto fail;
        }
-
-       ifq_set_cpuid(&ifp->if_snd, rman_get_cpuid(adapter->intr_res));
        return (0);
 fail:
        em_detach(dev);
index 6068b9f..23d7c1b 100644 (file)
@@ -324,6 +324,8 @@ ep_isa_attach(device_t dev)
                goto bad;
        }
 
+       ifq_set_cpuid(&ifp->if_snd, rman_get_cpuid(sc->irq));
+
        error = bus_setup_intr(dev, sc->irq, INTR_MPSAFE, ep_intr,
                               sc, &sc->ep_intrhand, ifp->if_serializer);
        if (error) {
@@ -331,8 +333,6 @@ ep_isa_attach(device_t dev)
                goto bad;
        }
 
-       ifq_set_cpuid(&ifp->if_snd, rman_get_cpuid(sc->irq));
-
        return (0);
 bad:
        ep_free(dev);
index 4b8a3ee..29742fd 100644 (file)
@@ -210,6 +210,8 @@ ep_pccard_attach(device_t dev)
                goto bad;
        }
 
+       ifq_set_cpuid(&ifp->if_snd, rman_get_cpuid(sc->irq));
+
        error = bus_setup_intr(dev, sc->irq, INTR_MPSAFE, ep_intr,
                                    sc, &sc->ep_intrhand, 
                                    sc->arpcom.ac_if.if_serializer);
@@ -218,8 +220,6 @@ ep_pccard_attach(device_t dev)
                goto bad;
        }
 
-       ifq_set_cpuid(&ifp->if_snd, rman_get_cpuid(sc->irq));
-
        return (0);
 bad:
        ep_free(dev);
index 9dd9bcb..fbc96bc 100644 (file)
@@ -365,6 +365,8 @@ et_attach(device_t dev)
 
        ether_ifattach(ifp, eaddr, NULL);
 
+       ifq_set_cpuid(&ifp->if_snd, rman_get_cpuid(sc->sc_irq_res));
+
        error = bus_setup_intr(dev, sc->sc_irq_res, INTR_MPSAFE, et_intr, sc,
                               &sc->sc_irq_handle, ifp->if_serializer);
        if (error) {
@@ -373,8 +375,6 @@ et_attach(device_t dev)
                goto fail;
        }
 
-       ifq_set_cpuid(&ifp->if_snd, rman_get_cpuid(sc->sc_irq_res));
-
        return 0;
 fail:
        et_detach(dev);
index 41fa841..6b8918b 100644 (file)
@@ -279,6 +279,8 @@ ex_isa_attach(device_t dev)
                goto bad;
        }
 
+       ifq_set_cpuid(&ifp->if_snd, rman_get_cpuid(sc->irq));
+
        error = bus_setup_intr(dev, sc->irq, INTR_MPSAFE,
                                ex_intr, (void *)sc, &sc->ih, 
                                ifp->if_serializer);
@@ -287,8 +289,6 @@ ex_isa_attach(device_t dev)
                goto bad;
        }
 
-       ifq_set_cpuid(&ifp->if_snd, rman_get_cpuid(sc->irq));
-
        return(0);
 bad:
        ex_release_resources(dev);
index 68ba9d6..93a7e3d 100644 (file)
@@ -160,6 +160,8 @@ ex_pccard_attach(device_t dev)
                goto bad;
        }
 
+       ifq_set_cpuid(&ifp->if_snd, rman_get_cpuid(sc->irq));
+
        error = bus_setup_intr(dev, sc->irq, INTR_MPSAFE,
                                ex_intr, (void *)sc, &sc->ih, 
                                ifp->if_serializer);
@@ -168,8 +170,6 @@ ex_pccard_attach(device_t dev)
                goto bad;
        }
 
-       ifq_set_cpuid(&ifp->if_snd, rman_get_cpuid(sc->irq));
-
        return(0);
 bad:
        ex_release_resources(dev);
index 9ee9173..7b03a5f 100644 (file)
@@ -818,6 +818,9 @@ fe_attach (device_t dev)
 
        /* Attach and stop the interface. */
        ether_ifattach(&sc->sc_if, sc->sc_enaddr, NULL);
+
+       ifq_set_cpuid(&sc->sc_if.if_snd, rman_get_cpuid(sc->irq_res));
+
        fe_stop(sc);
 
        error = bus_setup_intr(dev, sc->irq_res, INTR_MPSAFE,
@@ -828,8 +831,6 @@ fe_attach (device_t dev)
                fe_release_resource(dev);
                return ENXIO;
        }
-
-       ifq_set_cpuid(&sc->sc_if.if_snd, rman_get_cpuid(sc->irq_res));
   
        /* Print additional info when attached.  */
        device_printf(dev, "type %s%s\n", sc->typestr,
index 97bb0fd..ad78944 100644 (file)
@@ -679,6 +679,8 @@ fxp_attach(device_t dev)
        ifq_set_maxlen(&ifp->if_snd, FXP_USABLE_TXCB);
        ifq_set_ready(&ifp->if_snd);
 
+       ifq_set_cpuid(&ifp->if_snd, rman_get_cpuid(sc->irq));
+
        error = bus_setup_intr(dev, sc->irq, INTR_MPSAFE,
                               fxp_intr, sc, &sc->ih, 
                               ifp->if_serializer);
@@ -690,8 +692,6 @@ fxp_attach(device_t dev)
                goto fail;
        }
 
-       ifq_set_cpuid(&ifp->if_snd, rman_get_cpuid(sc->irq));
-
        return (0);
 
 failmem:
index 6589b49..9647a62 100644 (file)
@@ -303,6 +303,8 @@ iwl2100_attach(device_t dev)
 
        ieee80211_media_init(ic, iwl2100_media_change, iwl2100_media_status);
 
+       ifq_set_cpuid(&ifp->if_snd, rman_get_cpuid(sc->sc_irq_res));
+
        error = bus_setup_intr(dev, sc->sc_irq_res, INTR_MPSAFE,
                               iwl2100_intr, sc, &sc->sc_irq_handle,
                               ifp->if_serializer);
@@ -312,8 +314,6 @@ iwl2100_attach(device_t dev)
                return ENXIO;
        }
 
-       ifq_set_cpuid(&ifp->if_snd, rman_get_cpuid(sc->sc_irq_res));
-
        /*
         * Attach radio tap
         */
index 91e7908..bd2244d 100644 (file)
@@ -548,6 +548,8 @@ lge_attach(device_t dev)
         */
        ether_ifattach(ifp, eaddr, NULL);
 
+       ifq_set_cpuid(&ifp->if_snd, rman_get_cpuid(sc->lge_irq));
+
        error = bus_setup_intr(dev, sc->lge_irq, INTR_MPSAFE,
                               lge_intr, sc, &sc->lge_intrhand, 
                               ifp->if_serializer);
@@ -557,8 +559,6 @@ lge_attach(device_t dev)
                goto fail;
        }
 
-       ifq_set_cpuid(&ifp->if_snd, rman_get_cpuid(sc->lge_irq));
-
        return(0);
 
 fail:
index 495e627..82d3853 100644 (file)
@@ -422,6 +422,8 @@ le_isa_attach(device_t dev)
                goto fail_dmap;
        }
 
+       ifq_set_cpuid(&sc->ifp->if_snd, rman_get_cpuid(lesc->sc_ires));
+
        error = bus_setup_intr(dev, lesc->sc_ires, INTR_MPSAFE,
            am7990_intr, sc, &lesc->sc_ih, sc->ifp->if_serializer);
        if (error != 0) {
@@ -429,8 +431,6 @@ le_isa_attach(device_t dev)
                goto fail_am7990;
        }
 
-       ifq_set_cpuid(&sc->ifp->if_snd, rman_get_cpuid(lesc->sc_ires));
-
        return (0);
 
  fail_am7990:
index 28dddaa..2f13256 100644 (file)
@@ -437,6 +437,8 @@ le_pci_attach(device_t dev)
                goto fail_dmap;
        }
 
+       ifq_set_cpuid(&sc->ifp->if_snd, rman_get_cpuid(lesc->sc_ires));
+
        error = bus_setup_intr(dev, lesc->sc_ires, INTR_MPSAFE,
            am79900_intr, sc, &lesc->sc_ih, sc->ifp->if_serializer);
        if (error != 0) {
@@ -444,8 +446,6 @@ le_pci_attach(device_t dev)
                goto fail_am79900;
        }
 
-       ifq_set_cpuid(&sc->ifp->if_snd, rman_get_cpuid(lesc->sc_ires));
-
        return (0);
 
  fail_am79900:
index ad61266..ba1e224 100644 (file)
@@ -1728,6 +1728,12 @@ mskc_attach(device_t dev)
 
        bus_generic_attach(dev);
 
+       cpuid = rman_get_cpuid(sc->msk_irq);
+       if (sc->msk_if[0] != NULL)
+               ifq_set_cpuid(&sc->msk_if[0]->msk_ifp->if_snd, cpuid);
+       if (sc->msk_if[1] != NULL)
+               ifq_set_cpuid(&sc->msk_if[1]->msk_ifp->if_snd, cpuid);
+
        error = bus_setup_intr(dev, sc->msk_irq, INTR_MPSAFE,
                               mskc_intr, sc, &sc->msk_intrhand,
                               &sc->msk_serializer);
@@ -1735,12 +1741,6 @@ mskc_attach(device_t dev)
                device_printf(dev, "couldn't set up interrupt handler\n");
                goto fail;
        }
-
-       cpuid = rman_get_cpuid(sc->msk_irq);
-       if (sc->msk_if[0] != NULL)
-               ifq_set_cpuid(&sc->msk_if[0]->msk_ifp->if_snd, cpuid);
-       if (sc->msk_if[1] != NULL)
-               ifq_set_cpuid(&sc->msk_if[1]->msk_ifp->if_snd, cpuid);
        return 0;
 fail:
        mskc_detach(dev);
index 99b427a..4d8a59f 100644 (file)
@@ -951,6 +951,8 @@ my_attach(device_t dev)
 
        ether_ifattach(ifp, eaddr, NULL);
 
+       ifq_set_cpuid(&ifp->if_snd, rman_get_cpuid(sc->my_irq));
+
        error = bus_setup_intr(dev, sc->my_irq, INTR_MPSAFE,
                               my_intr, sc, &sc->my_intrhand, 
                               ifp->if_serializer);
@@ -960,8 +962,6 @@ my_attach(device_t dev)
                goto fail;
        }
 
-       ifq_set_cpuid(&ifp->if_snd, rman_get_cpuid(sc->my_irq));
-
        return (0);
 
 fail:
index 45a10f8..4c3152d 100644 (file)
@@ -646,6 +646,8 @@ nfe_attach(device_t dev)
 
        ether_ifattach(ifp, eaddr, NULL);
 
+       ifq_set_cpuid(&ifp->if_snd, rman_get_cpuid(sc->sc_irq_res));
+
 #ifdef IFPOLL_ENABLE
        ifpoll_compat_setup(&sc->sc_npoll,
            &sc->sc_sysctl_ctx, sc->sc_sysctl_tree, device_get_unit(dev),
@@ -660,8 +662,6 @@ nfe_attach(device_t dev)
                goto fail;
        }
 
-       ifq_set_cpuid(&ifp->if_snd, rman_get_cpuid(sc->sc_irq_res));
-
        return 0;
 fail:
        nfe_detach(dev);
index 27eab66..c957481 100644 (file)
@@ -900,6 +900,8 @@ nge_attach(device_t dev)
         */
        ether_ifattach(ifp, eaddr, NULL);
 
+       ifq_set_cpuid(&ifp->if_snd, rman_get_cpuid(sc->nge_irq));
+
 #ifdef IFPOLL_ENABLE
        ifpoll_compat_setup(&sc->nge_npoll, NULL, NULL, device_get_unit(dev),
            ifp->if_serializer);
@@ -914,8 +916,6 @@ nge_attach(device_t dev)
                goto fail;
        }
 
-       ifq_set_cpuid(&ifp->if_snd, rman_get_cpuid(sc->nge_irq));
-
        return(0);
 fail:
        nge_detach(dev);
index 04b9fa3..bcdd757 100644 (file)
@@ -614,6 +614,8 @@ pcn_attach(device_t dev)
         */
        ether_ifattach(ifp, eaddr, NULL);
 
+       ifq_set_cpuid(&ifp->if_snd, rman_get_cpuid(sc->pcn_irq));
+
        error = bus_setup_intr(dev, sc->pcn_irq, INTR_MPSAFE,
                               pcn_intr, sc, &sc->pcn_intrhand, 
                               ifp->if_serializer);
@@ -623,8 +625,6 @@ pcn_attach(device_t dev)
                goto fail;
        }
 
-       ifq_set_cpuid(&ifp->if_snd, rman_get_cpuid(sc->pcn_irq));
-
        return (0);
 fail:
        pcn_detach(dev);
index ed3709f..cf810af 100644 (file)
@@ -1601,6 +1601,8 @@ re_attach(device_t dev)
         */
        ether_ifattach(ifp, eaddr, NULL);
 
+       ifq_set_cpuid(&ifp->if_snd, rman_get_cpuid(sc->re_irq));
+
 #ifdef IFPOLL_ENABLE
        ifpoll_compat_setup(&sc->re_npoll,
            &sc->re_sysctl_ctx, sc->re_sysctl_tree, device_get_unit(dev),
@@ -1636,8 +1638,6 @@ re_attach(device_t dev)
                goto fail;
        }
 
-       ifq_set_cpuid(&ifp->if_snd, rman_get_cpuid(sc->re_irq));
-
 fail:
        if (error)
                re_detach(dev);
index a0e43db..8f21fcc 100644 (file)
@@ -873,6 +873,8 @@ rl_attach(device_t dev)
         */
        ether_ifattach(ifp, eaddr, NULL);
 
+       ifq_set_cpuid(&ifp->if_snd, rman_get_cpuid(sc->rl_irq));
+
 #ifdef IFPOLL_ENABLE
        ifpoll_compat_setup(&sc->rl_npoll, NULL, NULL, device_get_unit(dev),
            ifp->if_serializer);
@@ -887,8 +889,6 @@ rl_attach(device_t dev)
                goto fail;
        }
 
-       ifq_set_cpuid(&ifp->if_snd, rman_get_cpuid(sc->rl_irq));
-
        return(0);
 
 fail:
index 56fd4df..81f47c0 100644 (file)
@@ -3899,6 +3899,8 @@ rtw_attach(device_t dev)
        bpfattach_dlt(ifp, DLT_IEEE802_11_RADIO,
                      sizeof(struct ieee80211_frame) + 64, &sc->sc_radiobpf);
 
+       ifq_set_cpuid(&ifp->if_snd, rman_get_cpuid(sc->sc_irq_res));
+
        rc = bus_setup_intr(dev, sc->sc_irq_res, INTR_MPSAFE, rtw_intr, sc,
                            &sc->sc_irq_handle, ifp->if_serializer);
        if (rc) {
@@ -3908,8 +3910,6 @@ rtw_attach(device_t dev)
                goto err;
        }
 
-       ifq_set_cpuid(&ifp->if_snd, rman_get_cpuid(sc->sc_irq_res));
-
        device_printf(dev, "hardware version %c\n", sc->sc_hwverid);
        if (bootverbose)
                ieee80211_announce(ic);
index 8f08f81..50b1740 100644 (file)
@@ -142,15 +142,13 @@ sbni_pci_attach(device_t dev)
        if (sc->irq_res) {
                struct ifnet *ifp = &sc->arpcom.ac_if;
 
+               ifq_set_cpuid(&ifp->if_snd, rman_get_cpuid(sc->irq_res));
+
                error = bus_setup_intr(dev, sc->irq_res, INTR_MPSAFE,
                                       sbni_intr, sc, &sc->irq_handle,
                                       ifp->if_serializer);
-               if (error) {
+               if (error)
                        kprintf("sbni%d: bus_setup_intr\n", next_sbni_unit);
-               } else {
-                       ifq_set_cpuid(&ifp->if_snd,
-                           rman_get_cpuid(sc->irq_res));
-               }
        } else {
                kprintf("\nsbni%d: cannot claim irq!\n", next_sbni_unit);
        }
index 55b9cbb..1fabb01 100644 (file)
@@ -266,6 +266,8 @@ sbsh_attach(device_t dev)
 
        ether_ifattach(ifp, sc->arpcom.ac_enaddr, NULL);
 
+       ifq_set_cpuid(&ifp->if_snd, rman_get_cpuid(sc->irq_res));
+
        error = bus_setup_intr(dev, sc->irq_res, INTR_MPSAFE,
                                sbsh_intr, sc, &sc->intr_hand, 
                                ifp->if_serializer);
@@ -275,8 +277,6 @@ sbsh_attach(device_t dev)
                goto fail;
        }
 
-       ifq_set_cpuid(&ifp->if_snd, rman_get_cpuid(sc->irq_res));
-
        return(0);
 
 fail:
index 617f82f..3aeb47b 100644 (file)
@@ -768,6 +768,8 @@ sf_attach(device_t dev)
         */
        ether_ifattach(ifp, sc->arpcom.ac_enaddr, NULL);
 
+       ifq_set_cpuid(&ifp->if_snd, rman_get_cpuid(sc->sf_irq));
+
        error = bus_setup_intr(dev, sc->sf_irq, INTR_MPSAFE,
                               sf_intr, sc, &sc->sf_intrhand, 
                               ifp->if_serializer);
@@ -778,8 +780,6 @@ sf_attach(device_t dev)
                goto fail;
        }
 
-       ifq_set_cpuid(&ifp->if_snd, rman_get_cpuid(sc->sf_irq));
-
        return(0);
 
 fail:
index 6011cfc..2f84ab6 100644 (file)
@@ -1168,6 +1168,8 @@ sis_attach(device_t dev)
         */
        ifp->if_data.ifi_hdrlen = sizeof(struct ether_vlan_header);
 
+       ifq_set_cpuid(&ifp->if_snd, rman_get_cpuid(sc->sis_irq));
+
        error = bus_setup_intr(dev, sc->sis_irq, INTR_MPSAFE,
                               sis_intr, sc, 
                               &sc->sis_intrhand, 
@@ -1179,8 +1181,6 @@ sis_attach(device_t dev)
                goto fail;
        }
 
-       ifq_set_cpuid(&ifp->if_snd, rman_get_cpuid(sc->sis_irq));
-
 fail:
        if (error)
                sis_detach(dev);
index b173f3b..43e6e9d 100644 (file)
@@ -1515,6 +1515,12 @@ skc_attach(device_t dev)
 
        bus_generic_attach(dev);
 
+       cpuid = rman_get_cpuid(sc->sk_irq);
+       if (sc->sk_if[0] != NULL)
+               ifq_set_cpuid(&sc->sk_if[0]->arpcom.ac_if.if_snd, cpuid);
+       if (sc->sk_if[1] != NULL)
+               ifq_set_cpuid(&sc->sk_if[1]->arpcom.ac_if.if_snd, cpuid);
+
        error = bus_setup_intr(dev, sc->sk_irq, INTR_MPSAFE, sk_intr, sc,
                               &sc->sk_intrhand, &sc->sk_serializer);
        if (error) {
@@ -1522,12 +1528,6 @@ skc_attach(device_t dev)
                goto fail;
        }
 
-       cpuid = rman_get_cpuid(sc->sk_irq);
-       if (sc->sk_if[0] != NULL)
-               ifq_set_cpuid(&sc->sk_if[0]->arpcom.ac_if.if_snd, cpuid);
-       if (sc->sk_if[1] != NULL)
-               ifq_set_cpuid(&sc->sk_if[1]->arpcom.ac_if.if_snd, cpuid);
-
        return 0;
 fail:
        skc_detach(dev);
index a87ab01..d2fb7dc 100644 (file)
@@ -256,6 +256,8 @@ sln_attach(device_t dev)
 
        ether_ifattach(ifp, eaddr, NULL);
 
+       ifq_set_cpuid(&ifp->if_snd, rman_get_cpuid(sc->sln_irq));
+
        error = bus_setup_intr(dev, sc->sln_irq, INTR_MPSAFE, sln_interrupt, sc,
                               &sc->sln_intrhand, ifp->if_serializer);
        if (error) {
@@ -266,8 +268,6 @@ sln_attach(device_t dev)
                goto fail;
        }
 
-       ifq_set_cpuid(&ifp->if_snd, rman_get_cpuid(sc->sln_irq));
-
        return 0;
 fail:
        return error;
index 487504b..a3d3a54 100644 (file)
@@ -221,6 +221,8 @@ sn_attach(device_t dev)
 
        ether_ifattach(ifp, sc->arpcom.ac_enaddr, NULL);
 
+       ifq_set_cpuid(&ifp->if_snd, rman_get_cpuid(sc->irq_res));
+
        error = bus_setup_intr(dev, sc->irq_res, INTR_MPSAFE,
                               sn_intr, sc, &sc->intrhand,
                               ifp->if_serializer);
@@ -230,8 +232,6 @@ sn_attach(device_t dev)
                return error;
        }
 
-       ifq_set_cpuid(&ifp->if_snd, rman_get_cpuid(sc->irq_res));
-
        return 0;
 }
 
index 2408716..61217bf 100644 (file)
@@ -966,6 +966,8 @@ ste_attach(device_t dev)
          * Tell the upper layer(s) we support long frames.
          */
         ifp->if_data.ifi_hdrlen = sizeof(struct ether_vlan_header);
+
+       ifq_set_cpuid(&ifp->if_snd, rman_get_cpuid(sc->ste_irq));
  
        error = bus_setup_intr(dev, sc->ste_irq, INTR_MPSAFE,
                               ste_intr, sc, &sc->ste_intrhand, 
@@ -976,8 +978,6 @@ ste_attach(device_t dev)
                goto fail;
        }
 
-       ifq_set_cpuid(&ifp->if_snd, rman_get_cpuid(sc->ste_irq));
-
        return 0;
 
 fail:
index 9888047..f1ddd5c 100644 (file)
@@ -800,6 +800,8 @@ stge_attach(device_t dev)
        if ((cmd & PCIM_CMD_MWRICEN) == 0)
                sc->sc_DMACtrl |= DMAC_MWIDisable;
 
+       ifq_set_cpuid(&ifp->if_snd, rman_get_cpuid(sc->sc_irq));
+
        /*
         * Hookup IRQ
         */
@@ -811,8 +813,6 @@ stge_attach(device_t dev)
                goto fail;
        }
 
-       ifq_set_cpuid(&ifp->if_snd, rman_get_cpuid(sc->sc_irq));
-
 fail:
        if (error != 0)
                stge_detach(dev);
index 74ac9d6..0e8ed2b 100644 (file)
@@ -1563,6 +1563,8 @@ ti_attach(device_t dev)
         */
        ether_ifattach(ifp, eaddr, NULL);
 
+       ifq_set_cpuid(&ifp->if_snd, rman_get_cpuid(sc->ti_irq));
+
        error = bus_setup_intr(dev, sc->ti_irq, INTR_MPSAFE,
                               ti_intr, sc, &sc->ti_intrhand, 
                               ifp->if_serializer);
@@ -1572,8 +1574,6 @@ ti_attach(device_t dev)
                goto fail;
        }
 
-       ifq_set_cpuid(&ifp->if_snd, rman_get_cpuid(sc->ti_irq));
-
        return 0;
 fail:
        ti_detach(dev);
index ff66f22..94677f1 100644 (file)
@@ -1229,6 +1229,8 @@ tl_attach(device_t dev)
         */
        ether_ifattach(ifp, eaddr, NULL);
 
+       ifq_set_cpuid(&ifp->if_snd, rman_get_cpuid(sc->tl_irq));
+
        error = bus_setup_intr(dev, sc->tl_irq, INTR_MPSAFE,
                               tl_intr, sc, &sc->tl_intrhand, 
                               ifp->if_serializer);
@@ -1239,8 +1241,6 @@ tl_attach(device_t dev)
                goto fail;
        }
 
-       ifq_set_cpuid(&ifp->if_snd, rman_get_cpuid(sc->tl_irq));
-
        return(0);
 
 fail:
index cfc6e37..642acc4 100644 (file)
@@ -270,6 +270,8 @@ epic_attach(device_t dev)
        ether_ifattach(ifp, sc->sc_macaddr, NULL);
        ifp->if_hdrlen = sizeof(struct ether_vlan_header);
 
+       ifq_set_cpuid(&ifp->if_snd, rman_get_cpuid(sc->irq));
+
        error = bus_setup_intr(dev, sc->irq, INTR_MPSAFE,
                               epic_intr, sc, &sc->sc_ih, 
                               ifp->if_serializer);
@@ -280,8 +282,6 @@ epic_attach(device_t dev)
                goto fail;
        }
 
-       ifq_set_cpuid(&ifp->if_snd, rman_get_cpuid(sc->irq));
-
        return(0);
 
 fail:
index b4d6953..46f8a8a 100644 (file)
@@ -311,6 +311,8 @@ txp_attach(device_t dev)
 
        ether_ifattach(ifp, enaddr, NULL);
 
+       ifq_set_cpuid(&ifp->if_snd, rman_get_cpuid(sc->sc_irq));
+
        error = bus_setup_intr(dev, sc->sc_irq, INTR_MPSAFE,
                               txp_intr, sc, &sc->sc_intrhand, 
                               ifp->if_serializer);
@@ -320,8 +322,6 @@ txp_attach(device_t dev)
                goto fail;
        }
 
-       ifq_set_cpuid(&ifp->if_snd, rman_get_cpuid(sc->sc_irq));
-
        return(0);
 
 fail:
index d1bfc98..9a8b149 100644 (file)
@@ -1026,6 +1026,8 @@ vge_attach(device_t dev)
         */
        ether_ifattach(ifp, eaddr, NULL);
 
+       ifq_set_cpuid(&ifp->if_snd, rman_get_cpuid(sc->vge_irq));
+
 #ifdef IFPOLL_ENABLE
        ifpoll_compat_setup(&sc->vge_npoll, NULL, NULL, device_get_unit(dev),
            ifp->if_serializer);
@@ -1040,8 +1042,6 @@ vge_attach(device_t dev)
                goto fail;
        }
 
-       ifq_set_cpuid(&ifp->if_snd, rman_get_cpuid(sc->vge_irq));
-
        return 0;
 fail:
        vge_detach(dev);
index 4552013..fbd45b4 100644 (file)
@@ -790,6 +790,8 @@ vr_attach(device_t dev)
        /* Call MI attach routine. */
        ether_ifattach(ifp, eaddr, NULL);
 
+       ifq_set_cpuid(&ifp->if_snd, rman_get_cpuid(sc->vr_irq));
+
 #ifdef IFPOLL_ENABLE
        ifpoll_compat_setup(&sc->vr_npoll, NULL, NULL, device_get_unit(dev),
            ifp->if_serializer);
@@ -804,8 +806,6 @@ vr_attach(device_t dev)
                goto fail;
        }
 
-       ifq_set_cpuid(&ifp->if_snd, rman_get_cpuid(sc->vr_irq));
-
        return 0;
 
 fail:
index c41a4d6..010879f 100644 (file)
@@ -172,6 +172,8 @@ vx_pci_attach(device_t dev)
        }
     }
 
+    ifq_set_cpuid(&ifp->if_snd, rman_get_cpuid(sc->vx_irq));
+
     if (bus_setup_intr(dev, sc->vx_irq, INTR_MPSAFE,
                       vxintr, sc, &sc->vx_intrhand, 
                       ifp->if_serializer)
@@ -180,8 +182,6 @@ vx_pci_attach(device_t dev)
        goto bad;
     }
 
-    ifq_set_cpuid(&ifp->if_snd, rman_get_cpuid(sc->vx_irq));
-
     return(0);
 
 bad:
index 1a1ff35..d69eec8 100644 (file)
@@ -809,6 +809,8 @@ wb_attach(device_t dev)
         */
        ether_ifattach(ifp, eaddr, NULL);
 
+       ifq_set_cpuid(&ifp->if_snd, rman_get_cpuid(sc->wb_irq));
+
        error = bus_setup_intr(dev, sc->wb_irq, INTR_MPSAFE,
                               wb_intr, sc, &sc->wb_intrhand, 
                               ifp->if_serializer);
@@ -819,8 +821,6 @@ wb_attach(device_t dev)
                goto fail;
        }
 
-       ifq_set_cpuid(&ifp->if_snd, rman_get_cpuid(sc->wb_irq));
-
        return(0);
 
 fail:
index b8fa910..1edcff4 100644 (file)
@@ -327,6 +327,8 @@ xe_attach (device_t dev)
   /* Attach the interface */
   ether_ifattach(scp->ifp, scp->arpcom.ac_enaddr, NULL);
 
+  ifq_set_cpuid(&scp->ifp->if_snd, rman_get_cpuid(scp->irq_res));
+
   err = bus_setup_intr(dev, scp->irq_res, INTR_MPSAFE,
                       xe_intr, scp, &scp->intrhand,
                       scp->ifp->if_serializer);
@@ -337,8 +339,6 @@ xe_attach (device_t dev)
     return err;
   }
 
-  ifq_set_cpuid(&scp->ifp->if_snd, rman_get_cpuid(scp->irq_res));
-
   /* Done */
   return 0;
 }
index 17674b8..631d340 100644 (file)
@@ -1511,6 +1511,8 @@ done:
         */
        ether_ifattach(ifp, eaddr, NULL);
 
+       ifq_set_cpuid(&ifp->if_snd, rman_get_cpuid(sc->xl_irq));
+
 #ifdef IFPOLL_ENABLE
        ifpoll_compat_setup(&sc->xl_npoll, NULL, NULL, device_get_unit(dev),
            ifp->if_serializer);
@@ -1531,8 +1533,6 @@ done:
                goto fail;
        }
 
-       ifq_set_cpuid(&ifp->if_snd, rman_get_cpuid(sc->xl_irq));
-
        return 0;
 
 fail: