1
2
3
4
5
6
7
8
9
10
11
12 #ifndef _VMUR_H_
13 #define _VMUR_H_
14
15 #include <linux/refcount.h>
16
17 #define DEV_CLASS_UR_I 0x20
18 #define DEV_CLASS_UR_O 0x10
19
20
21
22
23
24
25
26 #define READER_PUNCH_DEVTYPE 0x2540
27 #define PRINTER_DEVTYPE 0x1403
28
29
30 struct file_control_block {
31 char reserved_1[8];
32 char user_owner[8];
33 char user_orig[8];
34 __s32 data_recs;
35 __s16 rec_len;
36 __s16 file_num;
37 __u8 file_stat;
38 __u8 dev_type;
39 char reserved_2[6];
40 char file_name[12];
41 char file_type[12];
42 char create_date[8];
43 char create_time[8];
44 char reserved_3[6];
45 __u8 file_class;
46 __u8 sfb_lok;
47 __u64 distr_code;
48 __u32 reserved_4;
49 __u8 current_starting_copy_number;
50 __u8 sfblock_cntrl_flags;
51 __u8 reserved_5;
52 __u8 more_status_flags;
53 char rest[200];
54 } __attribute__ ((packed));
55
56 #define FLG_SYSTEM_HOLD 0x04
57 #define FLG_CP_DUMP 0x10
58 #define FLG_USER_HOLD 0x20
59 #define FLG_IN_USE 0x80
60
61
62
63
64
65 struct urdev {
66 struct ccw_device *cdev;
67 struct mutex io_mutex;
68 struct completion *io_done;
69 struct device *device;
70 struct cdev *char_device;
71 struct ccw_dev_id dev_id;
72 size_t reclen;
73 int class;
74 int io_request_rc;
75 refcount_t ref_count;
76 wait_queue_head_t wait;
77 int open_flag;
78 spinlock_t open_lock;
79 };
80
81
82
83
84
85 struct urfile {
86 struct urdev *urd;
87 unsigned int flags;
88 size_t dev_reclen;
89 __u16 file_reclen;
90 };
91
92
93
94
95
96 #define UR_MAJOR 0
97
98
99
100
101 #define NUM_MINORS 65536
102
103
104 #define MAX_RECS_PER_IO 511
105 #define WRITE_CCW_CMD 0x01
106
107 #define TRACE(x...) debug_sprintf_event(vmur_dbf, 1, x)
108 #define CCWDEV_CU_DI(cutype, di) \
109 CCW_DEVICE(cutype, 0x00), .driver_info = (di)
110
111 #define FILE_RECLEN_OFFSET 4064
112
113 #endif