[ofa-general] [PATCH] Chelsio RHEL4 U2/U3 Support.

Steve Wise swise at opengridcomputing.com
Thu Mar 1 08:54:30 PST 2007


Vlad,

This patch fixes the compile problems with Chelsio cxgb3 on RHEL4 U2/U3.

You can pull this change from:

git://staging.openfabrics.org/~swise/ofed_1_2 rhel4u2-3

Thanks,

Steve.

---------------------


Chelsio RHEL4 U2/U3 Support.

Get them to compile.

Signed-off-by: Steve Wise <swise at opengridcomputing.com>
---

 .../backport/2.6.9_U2/include/linux/mii.h          |   13 +++++++++++++
 .../backport/2.6.9_U2/include/linux/spinlock.h     |   15 +++++++++++++++
 .../backport/2.6.9_U3/include/linux/spinlock.h     |   15 +++++++++++++++
 3 files changed, 43 insertions(+), 0 deletions(-)

diff --git a/kernel_addons/backport/2.6.9_U2/include/linux/mii.h b/kernel_addons/backport/2.6.9_U2/include/linux/mii.h
new file mode 100644
index 0000000..daaf8e1
--- /dev/null
+++ b/kernel_addons/backport/2.6.9_U2/include/linux/mii.h
@@ -0,0 +1,13 @@
+#ifndef BACKPORT_LINUX_MII_TO_SLES9SP3
+#define BACKPORT_LINUX_MII_TO_SLES9SP3
+
+#include_next <linux/mii.h>
+
+#define BMCR_SPEED1000              0x0040  /* MSB of Speed (1000)         */
+#define ADVERTISE_PAUSE_CAP     0x0400  /* Try for pause               */
+#define ADVERTISE_PAUSE_ASYM    0x0800  /* Try for asymetric pause     */
+#define MII_CTRL1000        0x09        /* 1000BASE-T control          */
+#define ADVERTISE_1000FULL      0x0200  /* Advertise 1000BASE-T full duplex */
+#define ADVERTISE_1000HALF      0x0100  /* Advertise 1000BASE-T half duplex */
+
+#endif
diff --git a/kernel_addons/backport/2.6.9_U2/include/linux/spinlock.h b/kernel_addons/backport/2.6.9_U2/include/linux/spinlock.h
index 0d24ba3..8f92e6e 100644
--- a/kernel_addons/backport/2.6.9_U2/include/linux/spinlock.h
+++ b/kernel_addons/backport/2.6.9_U2/include/linux/spinlock.h
@@ -3,9 +3,24 @@ #define BACKPORT_LINUX_SPINLOCK_H
 
 #include_next <linux/spinlock.h>
 #define DEFINE_SPINLOCK(x) spinlock_t x = SPIN_LOCK_UNLOCKED
+#define DEFINE_RWLOCK(x)	rwlock_t x = RW_LOCK_UNLOCKED
+
+#define spin_trylock_irqsave(lock, flags) \
+({ \
+        local_irq_save(flags); \
+        spin_trylock(lock) ? \
+        1 : ({local_irq_restore(flags); 0;}); \
+})
 
 #define spin_lock_nested(lock, subclass) spin_lock(lock)
 
+#define spin_trylock_irq(lock) \
+({ \
+	local_irq_disable(); \
+	spin_trylock(lock) ? \
+	1 : ({ local_irq_enable(); 0;  }); \
+})
+
 #define assert_spin_locked(lock)  do { (void)(lock); } while(0)
 
 #endif
diff --git a/kernel_addons/backport/2.6.9_U3/include/linux/spinlock.h b/kernel_addons/backport/2.6.9_U3/include/linux/spinlock.h
index 0d24ba3..8f92e6e 100644
--- a/kernel_addons/backport/2.6.9_U3/include/linux/spinlock.h
+++ b/kernel_addons/backport/2.6.9_U3/include/linux/spinlock.h
@@ -3,9 +3,24 @@ #define BACKPORT_LINUX_SPINLOCK_H
 
 #include_next <linux/spinlock.h>
 #define DEFINE_SPINLOCK(x) spinlock_t x = SPIN_LOCK_UNLOCKED
+#define DEFINE_RWLOCK(x)	rwlock_t x = RW_LOCK_UNLOCKED
+
+#define spin_trylock_irqsave(lock, flags) \
+({ \
+        local_irq_save(flags); \
+        spin_trylock(lock) ? \
+        1 : ({local_irq_restore(flags); 0;}); \
+})
 
 #define spin_lock_nested(lock, subclass) spin_lock(lock)
 
+#define spin_trylock_irq(lock) \
+({ \
+	local_irq_disable(); \
+	spin_trylock(lock) ? \
+	1 : ({ local_irq_enable(); 0;  }); \
+})
+
 #define assert_spin_locked(lock)  do { (void)(lock); } while(0)
 
 #endif




More information about the general mailing list