iTCO_wdt: fix TCO V1 timeout values and limits
[safe/jmp/linux-2.6] / drivers / ieee1394 / ieee1394_core.h
index ad52652..28b9f58 100644 (file)
@@ -5,6 +5,7 @@
 #include <linux/fs.h>
 #include <linux/list.h>
 #include <linux/types.h>
+#include <linux/cdev.h>
 #include <asm/atomic.h>
 
 #include "hosts.h"
@@ -24,9 +25,8 @@ struct hpsb_packet {
 
        nodeid_t node_id;
 
-       /* Async and Iso types should be clear, raw means send-as-is, do not
-        * CRC!  Byte swapping shall still be done in this case. */
-       enum { hpsb_async, hpsb_iso, hpsb_raw } __attribute__((packed)) type;
+       /* hpsb_raw = send as-is, do not CRC (but still byte-swap it) */
+       enum { hpsb_async, hpsb_raw } __attribute__((packed)) type;
 
        /* Okay, this is core internal and a no care for hosts.
         * queued   = queued for sending
@@ -37,7 +37,7 @@ struct hpsb_packet {
                hpsb_unused, hpsb_queued, hpsb_pending, hpsb_complete
        } __attribute__((packed)) state;
 
-       /* These are core internal. */
+       /* These are core-internal. */
        signed char tlabel;
        signed char ack_code;
        unsigned char tcode;
@@ -62,11 +62,15 @@ struct hpsb_packet {
        /* Store jiffies for implementing bus timeouts. */
        unsigned long sendtime;
 
-       /* Sizes are in bytes. *data can be DMA-mapped. */
+       /* Core-internal.  */
        size_t allocated_data_size;     /* as allocated */
+
+       /* Sizes are in bytes. To be set by caller of hpsb_alloc_packet. */
        size_t data_size;               /* as filled in */
        size_t header_size;             /* as filled in, not counting the CRC */
-       quadlet_t *data;
+
+       /* Buffers */
+       quadlet_t *data;                /* can be DMA-mapped */
        quadlet_t header[5];
        quadlet_t embedded_data[0];     /* keep as last member */
 };
@@ -152,7 +156,10 @@ void hpsb_packet_received(struct hpsb_host *host, quadlet_t *data, size_t size,
  */
 static inline unsigned char ieee1394_file_to_instance(struct file *file)
 {
-       return file->f_path.dentry->d_inode->i_cindex;
+       int idx = cdev_index(file->f_path.dentry->d_inode);
+       if (idx < 0)
+               idx = 0;
+       return idx;
 }
 
 extern int hpsb_disable_irm;