- Linus: more PageDirty / swapcache handling
[davej-history.git] / drivers / ieee1394 / ieee1394_types.h
blobc55f7e66bbe4fa56266e8e5ed9a5deff20051cfa
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"
14 #else
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,
18 #endif
20 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,18)
21 #include <asm/spinlock.h>
22 #else
23 #include <linux/spinlock.h>
24 #endif
26 #ifndef MIN
27 #define MIN(a,b) ((a) < (b) ? (a) : (b))
28 #endif
30 #ifndef MAX
31 #define MAX(a,b) ((a) > (b) ? (a) : (b))
32 #endif
34 typedef u32 quadlet_t;
35 typedef u64 octlet_t;
36 typedef u16 nodeid_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__)
56 #ifdef __BIG_ENDIAN
58 static __inline__ void *memcpy_le32(u32 *dest, const u32 *src, size_t count)
60 void *tmp = dest;
62 count /= 4;
64 while (count--) {
65 *dest++ = swab32p(src++);
68 return tmp;
71 #else
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 */