2 #ifndef _IEEE1394_TYPES_H
3 #define _IEEE1394_TYPES_H
5 #include <linux/kernel.h>
6 #include <linux/types.h>
7 #include <linux/version.h>
8 #include <linux/list.h>
9 #include <asm/byteorder.h>
12 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,0)
13 #include "linux22compat.h"
15 #define V22_COMPAT_MOD_INC_USE_COUNT do {} while (0)
16 #define V22_COMPAT_MOD_DEC_USE_COUNT do {} while (0)
17 #define OWNER_THIS_MODULE owner: THIS_MODULE,
20 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,18)
21 #include <asm/spinlock.h>
23 #include <linux/spinlock.h>
27 #define MIN(a,b) ((a) < (b) ? (a) : (b))
31 #define MAX(a,b) ((a) > (b) ? (a) : (b))
34 typedef u32 quadlet_t
;
38 #define BUS_MASK 0xffc0
39 #define NODE_MASK 0x003f
40 #define LOCAL_BUS 0xffc0
41 #define ALL_NODES 0x003f
43 #define HPSB_PRINT(level, fmt, args...) printk(level "ieee1394: " fmt "\n" , ## args)
45 #define HPSB_DEBUG(fmt, args...) HPSB_PRINT(KERN_DEBUG, fmt , ## args)
46 #define HPSB_INFO(fmt, args...) HPSB_PRINT(KERN_INFO, fmt , ## args)
47 #define HPSB_NOTICE(fmt, args...) HPSB_PRINT(KERN_NOTICE, fmt , ## args)
48 #define HPSB_WARN(fmt, args...) HPSB_PRINT(KERN_WARNING, fmt , ## args)
49 #define HPSB_ERR(fmt, args...) HPSB_PRINT(KERN_ERR, fmt , ## args)
51 #define HPSB_PANIC(fmt, args...) panic("ieee1394: " fmt "\n" , ## args)
53 #define HPSB_TRACE() HPSB_PRINT(KERN_INFO, "TRACE - %s, %s(), line %d", __FILE__, __FUNCTION__, __LINE__)
58 static __inline__
void *memcpy_le32(u32
*dest
, const u32
*src
, size_t count
)
65 *dest
++ = swab32p(src
++);
73 static __inline__
void *memcpy_le32(u32
*dest
, const u32
*src
, size_t count
)
75 return memcpy(dest
, src
, count
);
78 #endif /* __BIG_ENDIAN */
80 #endif /* _IEEE1394_TYPES_H */