summaryrefslogtreecommitdiffstats
path: root/include/asm-s390/ccwcache.h
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2001-03-09 20:33:35 +0000
committerRalf Baechle <ralf@linux-mips.org>2001-03-09 20:33:35 +0000
commit116674acc97ba75a720329996877077d988443a2 (patch)
tree6a3f2ff0b612ae2ee8a3f3509370c9e6333a53b3 /include/asm-s390/ccwcache.h
parent71118c319fcae4a138f16e35b4f7e0a6d53ce2ca (diff)
Merge with Linux 2.4.2.
Diffstat (limited to 'include/asm-s390/ccwcache.h')
-rw-r--r--include/asm-s390/ccwcache.h84
1 files changed, 84 insertions, 0 deletions
diff --git a/include/asm-s390/ccwcache.h b/include/asm-s390/ccwcache.h
new file mode 100644
index 000000000..cfbb03bf2
--- /dev/null
+++ b/include/asm-s390/ccwcache.h
@@ -0,0 +1,84 @@
+/*
+ * File...........: linux/include/asm-s390/ccwcache.h
+ * Author(s)......: Holger Smolinski <Holger.Smolinski@de.ibm.com>
+ * Bugreports.to..: <Linux390@de.ibm.com>
+ * (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 2000
+ */
+#ifndef CCWCACHE_H
+#define CCWCACHE_H
+#include <linux/slab.h>
+#include <asm/irq.h>
+
+#ifndef __KERNEL__
+#define kmem_cache_t void
+#endif /* __KERNEL__ */
+
+typedef struct ccw_req_t {
+ /* eye catcher plus queueing information */
+ unsigned int magic;
+ struct ccw_req_t *next; /* pointer to next ccw_req_t in queue */
+ struct ccw_req_t *int_next; /* for internal queueing */
+ struct ccw_req_t *int_prev; /* for internal queueing */
+
+ /* Where to execute what... */
+ void *device; /* index of the device the req is for */
+ void *req; /* pointer to originating request */
+ ccw1_t *cpaddr; /* address of channel program */
+ char status; /* reflecting the status of this request */
+ char flags; /* see below */
+ short retries; /* A retry counter to be set when filling */
+
+ /* ... and how */
+ int options; /* options for execution */
+ char lpm; /* logical path mask */
+ void *data; /* pointer to data area */
+ devstat_t *dstat; /* The device status in case of an error */
+
+ /* these are important for recovering erroneous requests */
+ struct ccw_req_t *refers; /* Does this request refer to another one? */
+ void *function; /* refers to the originating ERP action */ ;
+
+ unsigned long long expires; /* expiratioj period */
+ /* these are for profiling purposes */
+ unsigned long long buildclk; /* TOD-clock of request generation */
+ unsigned long long startclk; /* TOD-clock of request start */
+ unsigned long long stopclk; /* TOD-clock of request interrupt */
+ unsigned long long endclk; /* TOD-clock of request termination */
+
+ /* these are for internal use */
+ int cplength; /* length of the channel program in CCWs */
+ int datasize; /* amount of additional data in bytes */
+ kmem_cache_t *cache; /* the cache this data comes from */
+
+} __attribute__ ((aligned(4))) ccw_req_t;
+
+/*
+ * ccw_req_t -> status can be:
+ */
+#define CQR_STATUS_EMPTY 0x00 /* request is empty */
+#define CQR_STATUS_FILLED 0x01 /* request is ready to be preocessed */
+#define CQR_STATUS_QUEUED 0x02 /* request is queued to be processed */
+#define CQR_STATUS_IN_IO 0x03 /* request is currently in IO */
+#define CQR_STATUS_DONE 0x04 /* request is completed sucessfully */
+#define CQR_STATUS_ERROR 0x05 /* request is completed with error */
+#define CQR_STATUS_FAILED 0x06 /* request is finally failed */
+
+#define CQR_FLAGS_CHAINED 0x01 /* request is chained by another (last CCW is TIC) */
+
+#ifdef __KERNEL__
+#define SMALLEST_SLAB (sizeof(struct ccw_req_t) <= 128 ? 128 :\
+ sizeof(struct ccw_req_t) <= 256 ? 256 : 512 )
+
+/* SMALLEST_SLAB(1),... PAGE_SIZE(CCW_NUMBER_CACHES) */
+#define CCW_NUMBER_CACHES (sizeof(struct ccw_req_t) <= 128 ? 6 :\
+ sizeof(struct ccw_req_t) <= 256 ? 5 : 4 )
+
+int ccwcache_init (void);
+
+ccw_req_t *ccw_alloc_request (char *magic, int cplength, int additional_data);
+void ccw_free_request (ccw_req_t * request);
+#endif /* __KERNEL__ */
+#endif /* CCWCACHE_H */
+
+
+