patch-2.4.21 linux-2.4.21/drivers/ieee1394/ieee1394_types.h
Next file: linux-2.4.21/drivers/ieee1394/iso.c
Previous file: linux-2.4.21/drivers/ieee1394/ieee1394_transactions.h
Back to the patch index
Back to the overall index
- Lines: 101
- Date:
2003-06-13 07:51:34.000000000 -0700
- Orig file:
linux-2.4.20/drivers/ieee1394/ieee1394_types.h
- Orig date:
2002-08-02 17:39:44.000000000 -0700
diff -urN linux-2.4.20/drivers/ieee1394/ieee1394_types.h linux-2.4.21/drivers/ieee1394/ieee1394_types.h
@@ -7,49 +7,10 @@
#include <linux/version.h>
#include <linux/list.h>
#include <linux/init.h>
+#include <asm/semaphore.h>
#include <asm/byteorder.h>
-/* The great kdev_t changeover in 2.5.x */
-#include <linux/kdev_t.h>
-#ifndef minor
-#define minor(dev) MINOR(dev)
-#endif
-
-#ifndef __devexit_p
-#define __devexit_p(x) x
-#endif
-
-/* This showed up around this time */
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,12)
-
-# ifndef MODULE_LICENSE
-# define MODULE_LICENSE(x)
-# endif
-
-# ifndef min
-# define min(x,y) ({ \
- const typeof(x) _x = (x); \
- const typeof(y) _y = (y); \
- (void) (&_x == &_y); \
- _x < _y ? _x : _y; })
-# endif
-
-#endif /* Linux version < 2.4.12 */
-
-#include <linux/spinlock.h>
-
-#ifndef list_for_each_safe
-#define list_for_each_safe(pos, n, head) \
- for (pos = (head)->next, n = pos->next; pos != (head); \
- pos = n, n = pos->next)
-
-#endif
-
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,5)
-#define pte_offset_kernel pte_offset
-#endif
-
#ifndef MIN
#define MIN(a,b) ((a) < (b) ? (a) : (b))
#endif
@@ -58,19 +19,46 @@
#define MAX(a,b) ((a) > (b) ? (a) : (b))
#endif
+
+/* Transaction Label handling */
+struct hpsb_tlabel_pool {
+ DECLARE_BITMAP(pool, 64);
+ spinlock_t lock;
+ u8 next;
+ u32 allocations;
+ struct semaphore count;
+};
+
+#define HPSB_TPOOL_INIT(_tp) \
+do { \
+ CLEAR_BITMAP((_tp)->pool, 64); \
+ spin_lock_init(&(_tp)->lock); \
+ (_tp)->next = 0; \
+ (_tp)->allocations = 0; \
+ sema_init(&(_tp)->count, 63); \
+} while(0)
+
+
typedef u32 quadlet_t;
typedef u64 octlet_t;
typedef u16 nodeid_t;
+typedef u8 byte_t;
+typedef u64 nodeaddr_t;
+typedef u16 arm_length_t;
+
#define BUS_MASK 0xffc0
+#define BUS_SHIFT 6
#define NODE_MASK 0x003f
#define LOCAL_BUS 0xffc0
#define ALL_NODES 0x003f
+#define NODEID_TO_BUS(nodeid) ((nodeid & BUS_MASK) >> BUS_SHIFT)
+#define NODEID_TO_NODE(nodeid) (nodeid & NODE_MASK)
+
/* Can be used to consistently print a node/bus ID. */
-#define NODE_BUS_FMT "%02d:%04d"
-#define NODE_BUS_ARGS(nodeid) \
- (nodeid & NODE_MASK), ((nodeid & BUS_MASK) >> 6)
+#define NODE_BUS_FMT "%02d:%04d"
+#define NODE_BUS_ARGS(nodeid) NODEID_TO_NODE(nodeid), NODEID_TO_BUS(nodeid)
#define HPSB_PRINT(level, fmt, args...) printk(level "ieee1394: " fmt "\n" , ## args)
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)