1 /***********************************************************************
2 * drivers/s390/char/tapedefs.h
3 * tape device driver for S/390 and zSeries tapes.
5 * S390 and zSeries version
6 * Copyright (C) 2001 IBM Corporation
7 * Author(s): Carsten Otte <cotte@de.ibm.com>
8 * Tuan Ngo-Anh <ngoanh@de.ibm.com>
11 ***********************************************************************
14 /* Kernel Version Compatibility section */
15 #include <linux/version.h>
16 #include <linux/blkdev.h>
17 #include <linux/blk.h>
20 #if (LINUX_VERSION_CODE > KERNEL_VERSION(2,2,17))
21 #define TAPE_DEBUG // use s390 debug feature
23 #undef TAPE_DEBUG // debug feature not supported by our 2.2.16 code
24 static inline void set_normalized_cda ( ccw1_t * cp, unsigned long address ) {
27 static inline void clear_normalized_cda ( ccw1_t * ccw ) {
30 #define BUG() PRINT_FATAL("tape390: CRITICAL INTERNAL ERROR OCCURED. REPORT THIS BACK TO LINUX390@DE.IBM.COM\n")
32 #define CONFIG_S390_TAPE_DYNAMIC // allow devices to be attached or detached on the fly
33 #define TAPEBLOCK_RETRIES 20 // number of retries, when a block-dev request fails.
36 #if (LINUX_VERSION_CODE > KERNEL_VERSION(2,3,98))
37 #define INIT_BLK_DEV(d_major,d_request_fn,d_queue_fn,d_current) \
39 blk_dev[d_major].queue = d_queue_fn; \
41 static inline struct request *
42 tape_next_request( request_queue_t *queue )
44 return blkdev_entry_next_request(&queue->queue_head);
47 tape_dequeue_request( request_queue_t * q, struct request *req )
49 blkdev_dequeue_request (req);
52 #define s390_dev_info_t dev_info_t
53 typedef struct request *request_queue_t;
54 #ifndef init_waitqueue_head
55 #define init_waitqueue_head(x) do { *x = NULL; } while(0)
57 #define blk_init_queue(x,y) do {} while(0)
58 #define blk_queue_headactive(x,y) do {} while(0)
59 #define INIT_BLK_DEV(d_major,d_request_fn,d_queue_fn,d_current) \
61 blk_dev[d_major].request_fn = d_request_fn; \
62 blk_dev[d_major].queue = d_queue_fn; \
63 blk_dev[d_major].current_request = d_current; \
65 static inline struct request *
66 tape_next_request( request_queue_t *queue )
71 tape_dequeue_request( request_queue_t * q, struct request *req )