summaryrefslogtreecommitdiffstats
path: root/sys/pci/if_devar.h
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2005-07-27 13:51:01 +0000
committerjhb <jhb@FreeBSD.org>2005-07-27 13:51:01 +0000
commitd675d9c68fc46a791701a318b0c4035d0ce8e66a (patch)
tree64adba91a8e6fd65c24aaabdec7ea2fe0fad3dc1 /sys/pci/if_devar.h
parent53b633e1390a38e79e260411a9cf0bdd013ff633 (diff)
downloadFreeBSD-src-d675d9c68fc46a791701a318b0c4035d0ce8e66a.zip
FreeBSD-src-d675d9c68fc46a791701a318b0c4035d0ce8e66a.tar.gz
- Use callout_*() rather than timeout() to periodically poll the media.
- Add locking to protect the softc and mark this driver as MP safe. There are still some edge cases with multiport cards that need more locking work. MFC after: 1 week Tested on: alpha
Diffstat (limited to 'sys/pci/if_devar.h')
-rw-r--r--sys/pci/if_devar.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/sys/pci/if_devar.h b/sys/pci/if_devar.h
index 2d429de..46ff1ea 100644
--- a/sys/pci/if_devar.h
+++ b/sys/pci/if_devar.h
@@ -582,6 +582,8 @@ struct tulip_softc {
tulip_srom_connection_t tulip_conntype;
tulip_desc_t *tulip_rxdescs;
tulip_desc_t *tulip_txdescs;
+ struct callout tulip_callout;
+ struct mtx tulip_mutex;
};
#define tulip_curperfstats tulip_perfstats[TULIP_PERF_CURRENT]
@@ -975,4 +977,9 @@ TULIP_PERFREAD(void)
&& ((u_int16_t *)a1)[1] == 0xFFFFU \
&& ((u_int16_t *)a1)[2] == 0xFFFFU)
+#define TULIP_MUTEX(sc) (&(sc)->tulip_mutex)
+#define TULIP_LOCK(sc) mtx_lock(TULIP_MUTEX(sc))
+#define TULIP_UNLOCK(sc) mtx_unlock(TULIP_MUTEX(sc))
+#define TULIP_LOCK_ASSERT(sc) mtx_assert(TULIP_MUTEX(sc), MA_OWNED)
+
#endif /* _DEVAR_H */
OpenPOWER on IntegriCloud