PERFORCE change 36140 for review
Sam Leffler
sam at FreeBSD.org
Thu Aug 14 15:03:42 PDT 2003
http://perforce.freebsd.org/chv.cgi?CH=36140
Change 36140 by sam at sam_ebb on 2003/08/14 15:03:18
re-enable MPSAFE operation (somehow lost)
Affected files ...
.. //depot/projects/netperf/sys/pci/if_sis.c#5 edit
.. //depot/projects/netperf/sys/pci/if_sisreg.h#2 edit
Differences ...
==== //depot/projects/netperf/sys/pci/if_sis.c#5 (text+ko) ====
@@ -1228,7 +1228,7 @@
printf("sis%d: Ethernet address: %6D\n", unit, eaddr, ":");
sc->sis_unit = unit;
- callout_handle_init(&sc->sis_stat_ch);
+ callout_init(&sc->sis_stat_ch, CALLOUT_MPSAFE);
bcopy(eaddr, (char *)&sc->arpcom.ac_enaddr, ETHER_ADDR_LEN);
/*
@@ -1388,7 +1388,7 @@
ifp->if_capabilities |= IFCAP_VLAN_MTU;
/* Hook interrupt last to avoid having to lock softc */
- error = bus_setup_intr(dev, sc->sis_irq, INTR_TYPE_NET,
+ error = bus_setup_intr(dev, sc->sis_irq, INTR_TYPE_NET | INTR_MPSAFE,
sis_intr, sc, &sc->sis_intrhand);
if (error) {
@@ -1751,7 +1751,7 @@
sis_start(ifp);
}
- sc->sis_stat_ch = timeout(sis_tick, sc, hz);
+ callout_reset(&sc->sis_stat_ch, hz, sis_tick, sc);
sc->in_tick = 0;
SIS_UNLOCK(sc);
@@ -1967,6 +1967,7 @@
struct ifnet *ifp;
{
struct sis_softc *sc;
+ struct mbuf *m_head = NULL;
u_int32_t idx;
sc = ifp->if_softc;
@@ -1976,15 +1977,15 @@
SIS_UNLOCK(sc);
return;
}
+
+ idx = sc->sis_cdata.sis_tx_prod;
+
if (ifp->if_flags & IFF_OACTIVE) {
SIS_UNLOCK(sc);
return;
}
- idx = sc->sis_cdata.sis_tx_prod;
while(sc->sis_ldata.sis_tx_list[idx].sis_mbuf == NULL) {
- struct mbuf *m_head;
-
IF_DEQUEUE(&ifp->if_snd, m_head);
if (m_head == NULL)
break;
@@ -2189,7 +2190,7 @@
ifp->if_flags &= ~IFF_OACTIVE;
if (!sc->in_tick)
- sc->sis_stat_ch = timeout(sis_tick, sc, hz);
+ callout_reset(&sc->sis_stat_ch, hz, sis_tick, sc);
SIS_UNLOCK(sc);
@@ -2327,7 +2328,7 @@
ifp = &sc->arpcom.ac_if;
ifp->if_timer = 0;
- untimeout(sis_tick, sc, sc->sis_stat_ch);
+ callout_stop(&sc->sis_stat_ch);
ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE);
#ifdef DEVICE_POLLING
==== //depot/projects/netperf/sys/pci/if_sisreg.h#2 (text+ko) ====
@@ -459,7 +459,7 @@
bus_dma_tag_t sis_parent_tag;
bus_dma_tag_t sis_tag;
struct sis_ring_data sis_cdata;
- struct callout_handle sis_stat_ch;
+ struct callout sis_stat_ch;
#ifdef DEVICE_POLLING
int rxcycles;
#endif
More information about the p4-projects
mailing list