aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorKip Macy <kmacy@FreeBSD.org>2007-08-19 08:13:00 +0000
committerKip Macy <kmacy@FreeBSD.org>2007-08-19 08:13:00 +0000
commit196f78e3e35f0b13ea653986e17caec882cf05ca (patch)
tree93fa1177a61199d8fdd2f6127ea0da6a8128935b /sys
parentf048630ee48e858dc47c8e2104dfd52332a2c93a (diff)
Notes
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/cxgb/cxgb_adapter.h11
-rw-r--r--sys/dev/cxgb/cxgb_main.c2
2 files changed, 10 insertions, 3 deletions
diff --git a/sys/dev/cxgb/cxgb_adapter.h b/sys/dev/cxgb/cxgb_adapter.h
index 6605ea9693e4..bb3c7875044e 100644
--- a/sys/dev/cxgb/cxgb_adapter.h
+++ b/sys/dev/cxgb/cxgb_adapter.h
@@ -402,13 +402,20 @@ struct t3_rx_mode {
#define PORT_UNLOCK(port) sx_xunlock(&(port)->lock);
#define PORT_LOCK_INIT(port, name) SX_INIT(&(port)->lock, name)
#define PORT_LOCK_DEINIT(port) SX_DESTROY(&(port)->lock)
-#define PORT_LOCK_ASSERT_OWNED(port) sx_assert(&(port)->lock, SA_LOCKED)
#define ADAPTER_LOCK(adap) sx_xlock(&(adap)->lock);
#define ADAPTER_UNLOCK(adap) sx_xunlock(&(adap)->lock);
#define ADAPTER_LOCK_INIT(adap, name) SX_INIT(&(adap)->lock, name)
#define ADAPTER_LOCK_DEINIT(adap) SX_DESTROY(&(adap)->lock)
-#define ADAPTER_LOCK_ASSERT_NOTOWNED(adap) sx_assert(&(adap)->lock, SA_UNLOCKED)
+
+#if __FreeBSD_version > 700000
+#define ADAPTER_LOCK_ASSERT_NOTOWNED(adap)sx_assert(&(adap)->lock, SA_UNLOCKED)
+#define PORT_LOCK_ASSERT_OWNED(port) sx_assert(&(port)->lock, SA_LOCKED)
+#else
+#define ADAPTER_LOCK_ASSERT_NOTOWNED(adap)
+#define PORT_LOCK_ASSERT_OWNED(port)
+#endif
+
#else
#define PORT_LOCK(port) mtx_lock(&(port)->lock);
#define PORT_UNLOCK(port) mtx_unlock(&(port)->lock);
diff --git a/sys/dev/cxgb/cxgb_main.c b/sys/dev/cxgb/cxgb_main.c
index 04fd15fd5c44..d834c25ebc74 100644
--- a/sys/dev/cxgb/cxgb_main.c
+++ b/sys/dev/cxgb/cxgb_main.c
@@ -1921,7 +1921,7 @@ cxgb_start_tx(struct ifnet *ifp, uint32_t txmax)
*/
KASSERT((m->m_flags & M_IOVEC) == 0, ("IOVEC set too early"));
m0 = m;
-#ifdef INVARIANTS
+#if defined(INVARIANTS) && __FreeBSD_version > 700000
/*
* Clean up after net stack sloppiness
* before calling m_sanity