Linux kernel & device driver programming

Cross-Referenced Linux and Device Driver Code

[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ]
Version: [ 2.6.11.8 ] [ 2.6.25 ] [ 2.6.25.8 ] [ 2.6.31.13 ] Architecture: [ i386 ]
  1 #ifndef _IEEE1394_TYPES_H
  2 #define _IEEE1394_TYPES_H
  3 
  4 #include <linux/kernel.h>
  5 #include <linux/string.h>
  6 #include <linux/types.h>
  7 #include <asm/byteorder.h>
  8 
  9 typedef u32 quadlet_t;
 10 typedef u64 octlet_t;
 11 typedef u16 nodeid_t;
 12 
 13 typedef u8  byte_t;
 14 typedef u64 nodeaddr_t;
 15 typedef u16 arm_length_t;
 16 
 17 #define BUS_MASK  0xffc0
 18 #define BUS_SHIFT 6
 19 #define NODE_MASK 0x003f
 20 #define LOCAL_BUS 0xffc0
 21 #define ALL_NODES 0x003f
 22 
 23 #define NODEID_TO_BUS(nodeid)   ((nodeid & BUS_MASK) >> BUS_SHIFT)
 24 #define NODEID_TO_NODE(nodeid)  (nodeid & NODE_MASK)
 25 
 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)
 30 
 31 #define HPSB_PRINT(level, fmt, args...) \
 32         printk(level "ieee1394: " fmt "\n" , ## args)
 33 
 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)
 39 
 40 #ifdef CONFIG_IEEE1394_VERBOSEDEBUG
 41 #define HPSB_VERBOSE(fmt, args...)      HPSB_PRINT(KERN_DEBUG, fmt , ## args)
 42 #define HPSB_DEBUG_TLABELS
 43 #else
 44 #define HPSB_VERBOSE(fmt, args...)      do {} while (0)
 45 #endif
 46 
 47 #ifdef __BIG_ENDIAN
 48 
 49 static inline void *memcpy_le32(u32 *dest, const u32 *__src, size_t count)
 50 {
 51         void *tmp = dest;
 52         u32 *src = (u32 *)__src;
 53 
 54         count /= 4;
 55         while (count--)
 56                 *dest++ = swab32p(src++);
 57         return tmp;
 58 }
 59 
 60 #else
 61 
 62 static __inline__ void *memcpy_le32(u32 *dest, const u32 *src, size_t count)
 63 {
 64         return memcpy(dest, src, count);
 65 }
 66 
 67 #endif /* __BIG_ENDIAN */
 68 
 69 #endif /* _IEEE1394_TYPES_H */
 70 
  This page was automatically generated by the LXR engine.