summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorAndrew Morton <akpm@osdl.org>2004-05-14 05:46:01 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2004-05-14 05:46:01 -0700
commit7c11ccc5f5a7f71f2832c03f8c7fcbc9ee82a7de (patch)
tree6f5eadcc356367f903eeff1560e782299928b29b /include/linux
parent96005e5a21afaa7aa63f0a08333587f865b89948 (diff)
[PATCH] I2O subsystem fixing and cleanup for 2.6 - i2o-64-bit-fix.patch
From: Markus Lidel <Markus.Lidel@shadowconnect.com> * provides i2o_context_list_*() functions, which maps 64-bit pointers to 32-bit context id's in a dynamic list. On 32-bit systems the functions are replaced with a static inline. * i2o_scsi now uses the i2o_context_list_*() functions for transaction context, and therefore now work on 64-bit systems too.
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/i2o.h40
1 files changed, 40 insertions, 0 deletions
diff --git a/include/linux/i2o.h b/include/linux/i2o.h
index e21b548d29b8..23903655358d 100644
--- a/include/linux/i2o.h
+++ b/include/linux/i2o.h
@@ -76,6 +76,16 @@ struct i2o_device
};
/*
+ * 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
*/
struct i2o_controller
@@ -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
*/
@@ -649,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 */