1 #ifndef _IEEE1394_TYPES_H
2 #define _IEEE1394_TYPES_H
4 #include <linux/kernel.h>
5 #include <linux/string.h>
6 #include <linux/types.h>
7 #include <asm/byteorder.h>
14 typedef u64 nodeaddr_t;
15 typedef u16 arm_length_t;
17 #define BUS_MASK 0xffc0
19 #define NODE_MASK 0x003f
20 #define LOCAL_BUS 0xffc0
21 #define ALL_NODES 0x003f
23 #define NODEID_TO_BUS(nodeid) ((nodeid & BUS_MASK) >> BUS_SHIFT)
24 #define NODEID_TO_NODE(nodeid) (nodeid & NODE_MASK)
26 /* Can be used to consistently print a node/bus ID. */
27 #define NODE_BUS_FMT "%d-%02d:%04d"
28 #define NODE_BUS_ARGS(__host, __nodeid) \
29 __host->id, NODEID_TO_NODE(__nodeid), NODEID_TO_BUS(__nodeid)
31 #define HPSB_PRINT(level, fmt, args...) \
32 printk(level "ieee1394: " fmt "\n" , ## args)
34 #define HPSB_DEBUG(fmt, args...) HPSB_PRINT(KERN_DEBUG, fmt , ## args)
35 #define HPSB_INFO(fmt, args...) HPSB_PRINT(KERN_INFO, fmt , ## args)
36 #define HPSB_NOTICE(fmt, args...) HPSB_PRINT(KERN_NOTICE, fmt , ## args)
37 #define HPSB_WARN(fmt, args...) HPSB_PRINT(KERN_WARNING, fmt , ## args)
38 #define HPSB_ERR(fmt, args...) HPSB_PRINT(KERN_ERR, fmt , ## args)
40 #ifdef CONFIG_IEEE1394_VERBOSEDEBUG
41 #define HPSB_VERBOSE(fmt, args...) HPSB_PRINT(KERN_DEBUG, fmt , ## args)
42 #define HPSB_DEBUG_TLABELS
44 #define HPSB_VERBOSE(fmt, args...) do {} while (0)
49 static inline void *memcpy_le32(u32 *dest, const u32 *__src, size_t count)
52 u32 *src = (u32 *)__src;
56 *dest++ = swab32p(src++);
62 static __inline__ void *memcpy_le32(u32 *dest, const u32 *src, size_t count)
64 return memcpy(dest, src, count);
67 #endif /* __BIG_ENDIAN */
69 #endif /* _IEEE1394_TYPES_H */