1
2 #ifndef _IEEE1394_TYPES_H
3 #define _IEEE1394_TYPES_H
4
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>
10
11
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
19
20 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,18)
21 #include <asm/spinlock.h>
22 #else
23 #include <linux/spinlock.h>
24 #endif
25
26 #ifndef MIN
27 #define MIN(a,b) ((a) < (b) ? (a) : (b))
28 #endif
29
30 #ifndef MAX
31 #define MAX(a,b) ((a) > (b) ? (a) : (b))
32 #endif
33
34 typedef u32 quadlet_t;
35 typedef u64 octlet_t;
36 typedef u16 nodeid_t;
37
38 #define BUS_MASK 0xffc0
39 #define NODE_MASK 0x003f
40 #define LOCAL_BUS 0xffc0
41 #define ALL_NODES 0x003f
42
43 #define HPSB_PRINT(level, fmt, args...) printk(level "ieee1394: " fmt "\n" , ## args)
44
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)
50
51 #define HPSB_PANIC(fmt, args...) panic("ieee1394: " fmt "\n" , ## args)
52
53 #define HPSB_TRACE() HPSB_PRINT(KERN_INFO, "TRACE - %s, %s(), line %d", __FILE__, __FUNCTION__, __LINE__)
54
55
56 #ifdef __BIG_ENDIAN
57
58 static __inline__ void *memcpy_le32(u32 *dest, const u32 *src, size_t count)
59 {
60 void *tmp = dest;
61
62 count /= 4;
63
64 while (count--) {
65 *dest++ = swab32p(src++);
66 }
67
68 return tmp;
69 }
70
71 #else
72
73 static __inline__ void *memcpy_le32(u32 *dest, const u32 *src, size_t count)
74 {
75 return memcpy(dest, src, count);
76 }
77
78 #endif /* __BIG_ENDIAN */
79
80 #endif /* _IEEE1394_TYPES_H */
81
This page was automatically generated by the
LXR engine.
Visit the LXR main site for more
information.