1
2 /*
3 * sbull.h -- definitions for the char module
4 *
5 * Copyright (C) 2001 Alessandro Rubini and Jonathan Corbet
6 * Copyright (C) 2001 O'Reilly & Associates
7 *
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.
15 *
16 */
17
18
19 #include <linux/ioctl.h>
20
21 /* Multiqueue only works on 2.4 */
22 #ifdef SBULL_MULTIQUEUE
23 # warning "Multiqueue only works on 2.4 kernels"
24 #endif
25
26 /*
27 * Macros to help debugging
28 */
29
30 #undef PDEBUG /* undef it, just in case */
31 #ifdef SBULL_DEBUG
32 # ifdef __KERNEL__
33 /* This one if debugging is on, and kernel space */
34 # define PDEBUG(fmt, args...) printk( KERN_DEBUG "sbull: " fmt, ## args)
35 # else
36 /* This one for user space */
37 # define PDEBUG(fmt, args...) fprintf(stderr, fmt, ## args)
38 # endif
39 #else
40 # define PDEBUG(fmt, args...) /* not debugging: nothing */
41 #endif
42
43 #undef PDEBUGG
44 #define PDEBUGG(fmt, args...) /* nothing: it's a placeholder */
45
46
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 */
53
54 #define SBULLR_MAJOR 0 /* Dynamic major for raw device */
55 /*
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
58 * kernel timer
59 */
60
61 typedef struct Sbull_Dev {
62 int size;
63 int usage;
64 struct timer_list timer;
65 spinlock_t lock;
66 u8 *data;
67 #ifdef SBULL_MULTIQUEUE
68 request_queue_t *queue;
69 int busy;
70 #endif
71 } Sbull_Dev;
72
|
This page was automatically generated by the
LXR engine.
|