3 * sbull.h -- definitions for the char module
5 * Copyright (C) 2001 Alessandro Rubini and Jonathan Corbet
6 * Copyright (C) 2001 O'Reilly & Associates
8 * The source code in this file can be freely used, adapted,
9 * and redistributed in source or binary form, so long as an
10 * acknowledgment appears in derived source files. The citation
11 * should list that the code comes from the book "Linux Device
12 * Drivers" by Alessandro Rubini and Jonathan Corbet, published
13 * by O'Reilly & Associates. No warranty is attached;
14 * we cannot take responsibility for errors or fitness for use.
19 #include <linux/ioctl.h>
21 /* Multiqueue only works on 2.4 */
22 #ifdef SBULL_MULTIQUEUE
23 # warning "Multiqueue only works on 2.4 kernels"
27 * Macros to help debugging
30 #undef PDEBUG /* undef it, just in case */
33 /* This one if debugging is on, and kernel space */
34 # define PDEBUG(fmt, args...) printk( KERN_DEBUG "sbull: " fmt, ## args)
36 /* This one for user space */
37 # define PDEBUG(fmt, args...) fprintf(stderr, fmt, ## args)
40 # define PDEBUG(fmt, args...) /* not debugging: nothing */
44 #define PDEBUGG(fmt, args...) /* nothing: it's a placeholder */
47 #define SBULL_MAJOR 0 /* dynamic major by default */
48 #define SBULL_DEVS 2 /* two disks */
49 #define SBULL_RAHEAD 2 /* two sectors */
50 #define SBULL_SIZE 2048 /* two megs each */
51 #define SBULL_BLKSIZE 1024 /* 1k blocks */
52 #define SBULL_HARDSECT 512 /* 2.2 and 2.4 can used different values */
54 #define SBULLR_MAJOR 0 /* Dynamic major for raw device */
56 * The sbull device is removable: if it is left closed for more than
57 * half a minute, it is removed. Thus use a usage count and a
61 typedef struct Sbull_Dev {
64 struct timer_list timer;
67 #ifdef SBULL_MULTIQUEUE
68 request_queue_t *queue;