summaryrefslogtreecommitdiffstats
path: root/sys/dev/hme/if_hmevar.h
diff options
context:
space:
mode:
authoryongari <yongari@FreeBSD.org>2004-11-22 06:46:30 +0000
committeryongari <yongari@FreeBSD.org>2004-11-22 06:46:30 +0000
commite3c41706a978c3c2f188531c67241eaa32c298f2 (patch)
treeb2af333412e99d77d89f353d3b1dc0d3b65125b6 /sys/dev/hme/if_hmevar.h
parent158fb96a5a64c4ccbedbafd314b38883f2898b38 (diff)
downloadFreeBSD-src-e3c41706a978c3c2f188531c67241eaa32c298f2.zip
FreeBSD-src-e3c41706a978c3c2f188531c67241eaa32c298f2.tar.gz
Make hme(4) mpsafe
- Let hme_start()/hme_init() acquire lock and then call hme_start_locked()/hme_init_locked() respectivly. - Teardown interrupt handler before hme_detach(). - Remove IFF_NEEDSGIANT flag and mark interrupt handler INTR_MPSAFE. - Set callout handler to CALLOUT_MPSAFE. - Add locks in hme MII interface. Reviewed by: jake Tested by: Julian C. Dunn <jdunn at opentrend dot net> MFC after: 2 weeks
Diffstat (limited to 'sys/dev/hme/if_hmevar.h')
-rw-r--r--sys/dev/hme/if_hmevar.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/sys/dev/hme/if_hmevar.h b/sys/dev/hme/if_hmevar.h
index 4482fd4..fe752b1 100644
--- a/sys/dev/hme/if_hmevar.h
+++ b/sys/dev/hme/if_hmevar.h
@@ -138,11 +138,16 @@ struct hme_softc {
int sc_csum_features;
/* Ring descriptor */
- struct hme_ring sc_rb;
+ struct hme_ring sc_rb;
- int sc_debug;
+ int sc_debug;
+ struct mtx sc_lock;
};
+#define HME_LOCK(_sc) mtx_lock(&(_sc)->sc_lock)
+#define HME_UNLOCK(_sc) mtx_unlock(&(_sc)->sc_lock)
+#define HME_LOCK_ASSERT(_sc, _what) mtx_assert(&(_sc)->sc_lock, (_what))
+
extern devclass_t hme_devclass;
int hme_config(struct hme_softc *);
OpenPOWER on IntegriCloud