0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 #ifndef _VMUR_H_
0013 #define _VMUR_H_
0014
0015 #include <linux/refcount.h>
0016
0017 #define DEV_CLASS_UR_I 0x20
0018 #define DEV_CLASS_UR_O 0x10
0019
0020
0021
0022
0023
0024
0025
0026 #define READER_PUNCH_DEVTYPE 0x2540
0027 #define PRINTER_DEVTYPE 0x1403
0028
0029
0030 struct file_control_block {
0031 char reserved_1[8];
0032 char user_owner[8];
0033 char user_orig[8];
0034 __s32 data_recs;
0035 __s16 rec_len;
0036 __s16 file_num;
0037 __u8 file_stat;
0038 __u8 dev_type;
0039 char reserved_2[6];
0040 char file_name[12];
0041 char file_type[12];
0042 char create_date[8];
0043 char create_time[8];
0044 char reserved_3[6];
0045 __u8 file_class;
0046 __u8 sfb_lok;
0047 __u64 distr_code;
0048 __u32 reserved_4;
0049 __u8 current_starting_copy_number;
0050 __u8 sfblock_cntrl_flags;
0051 __u8 reserved_5;
0052 __u8 more_status_flags;
0053 char rest[200];
0054 } __attribute__ ((packed));
0055
0056 #define FLG_SYSTEM_HOLD 0x04
0057 #define FLG_CP_DUMP 0x10
0058 #define FLG_USER_HOLD 0x20
0059 #define FLG_IN_USE 0x80
0060
0061
0062
0063
0064
0065 struct urdev {
0066 struct ccw_device *cdev;
0067 struct mutex io_mutex;
0068 struct completion *io_done;
0069 struct device *device;
0070 struct cdev *char_device;
0071 struct ccw_dev_id dev_id;
0072 size_t reclen;
0073 int class;
0074 int io_request_rc;
0075 refcount_t ref_count;
0076 wait_queue_head_t wait;
0077 int open_flag;
0078 spinlock_t open_lock;
0079 };
0080
0081
0082
0083
0084
0085 struct urfile {
0086 struct urdev *urd;
0087 unsigned int flags;
0088 size_t dev_reclen;
0089 __u16 file_reclen;
0090 };
0091
0092
0093
0094
0095
0096 #define UR_MAJOR 0
0097
0098
0099
0100
0101 #define NUM_MINORS 65536
0102
0103
0104 #define MAX_RECS_PER_IO 511
0105 #define WRITE_CCW_CMD 0x01
0106
0107 #define TRACE(x...) debug_sprintf_event(vmur_dbf, 1, x)
0108 #define CCWDEV_CU_DI(cutype, di) \
0109 CCW_DEVICE(cutype, 0x00), .driver_info = (di)
0110
0111 #define FILE_RECLEN_OFFSET 4064
0112
0113 #endif