patch-2_6_7-vs1_9_1_12
[linux-2.6.git] / include / linux / i2o.h
index a59392a..2390365 100644 (file)
@@ -75,6 +75,16 @@ struct i2o_device
        char dev_name[8];               /* linux /dev name if available */
 };
 
+/*
+ * context queue entry, used for 32-bit context on 64-bit systems
+ */
+struct i2o_context_list_element {
+       struct i2o_context_list_element *next;
+       u32 context;
+       void *ptr;
+       unsigned int flags;
+};
+
 /*
  * Each I2O controller has one of these objects
  */
@@ -133,6 +143,11 @@ struct i2o_controller
 
        void *page_frame;                       /* Message buffers */
        dma_addr_t page_frame_map;              /* Cache map */
+#if BITS_PER_LONG == 64
+       spinlock_t context_list_lock;           /* lock for context_list */
+       struct i2o_context_list_element *context_list; /* list of context id's
+                                                   and pointers */
+#endif
 };
 
 /*
@@ -322,6 +337,27 @@ extern int i2o_activate_controller(struct i2o_controller *);
 extern void i2o_run_queue(struct i2o_controller *);
 extern int i2o_delete_controller(struct i2o_controller *);
 
+#if BITS_PER_LONG == 64
+extern u32 i2o_context_list_add(void *, struct i2o_controller *);
+extern void *i2o_context_list_get(u32, struct i2o_controller *);
+extern u32 i2o_context_list_remove(void *, struct i2o_controller *);
+#else
+static inline u32 i2o_context_list_add(void *ptr, struct i2o_controller *c)
+{
+       return (u32)ptr;
+}
+
+static inline void *i2o_context_list_get(u32 context, struct i2o_controller *c)
+{
+       return (void *)context;
+}
+
+static inline u32 i2o_context_list_remove(void *ptr, struct i2o_controller *c)
+{
+       return (u32)ptr;
+}
+#endif
+
 /*
  *     Cache strategies
  */
@@ -640,6 +676,8 @@ extern int i2o_delete_controller(struct i2o_controller *);
 #define HOST_TID               1
 
 #define MSG_FRAME_SIZE         64      /* i2o_scsi assumes >= 32 */
+#define REPLY_FRAME_SIZE       17
+#define SG_TABLESIZE           30
 #define NMBR_MSG_FRAMES                128
 
 #define MSG_POOL_SIZE          (MSG_FRAME_SIZE*NMBR_MSG_FRAMES*sizeof(u32))
@@ -647,5 +685,9 @@ extern int i2o_delete_controller(struct i2o_controller *);
 #define I2O_POST_WAIT_OK       0
 #define I2O_POST_WAIT_TIMEOUT  -ETIMEDOUT
 
+#define I2O_CONTEXT_LIST_MIN_LENGTH    15
+#define I2O_CONTEXT_LIST_USED          0x01
+#define I2O_CONTEXT_LIST_DELETED       0x02
+
 #endif /* __KERNEL__ */
 #endif /* _I2O_H */