summaryrefslogtreecommitdiffstats
path: root/sys/net/if_tapvar.h
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2004-03-17 01:09:59 +0000
committerrwatson <rwatson@FreeBSD.org>2004-03-17 01:09:59 +0000
commit90c4d019f1c1199a2e583bd63284144eb0c858e5 (patch)
tree5e7680f972641a6b6bccc91e5f96582ca5d9389d /sys/net/if_tapvar.h
parent7d2d6deecf36ab78dace21a1160668a957723bb8 (diff)
downloadFreeBSD-src-90c4d019f1c1199a2e583bd63284144eb0c858e5.zip
FreeBSD-src-90c4d019f1c1199a2e583bd63284144eb0c858e5.tar.gz
Add tap_mtx to tap_softc in order to protect per-softc variables
(tap_pid, tap_flags). if_tap should now be entirely MPSAFE. Committed from: Bamboo house by ocean in Taiwan Tropical paradise provided by: Chia-liang Kao <clkao@clkao.org>
Diffstat (limited to 'sys/net/if_tapvar.h')
-rw-r--r--sys/net/if_tapvar.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/sys/net/if_tapvar.h b/sys/net/if_tapvar.h
index 5b7312f..acd4528 100644
--- a/sys/net/if_tapvar.h
+++ b/sys/net/if_tapvar.h
@@ -41,6 +41,10 @@
#ifndef _NET_IF_TAPVAR_H_
#define _NET_IF_TAPVAR_H_
+/*
+ * tap_mtx locks tap_flags, tap_pid. tap_next locked with global tapmtx.
+ * Other fields locked by owning subsystems.
+ */
struct tap_softc {
struct arpcom arpcom; /* ethernet common data */
#define tap_if arpcom.ac_if
@@ -60,6 +64,7 @@ struct tap_softc {
SLIST_ENTRY(tap_softc) tap_next; /* next device in chain */
dev_t tap_dev;
+ struct mtx tap_mtx; /* per-softc mutex */
};
#endif /* !_NET_IF_TAPVAR_H_ */
OpenPOWER on IntegriCloud