1
2
3
4
5
6
7
8
9
10
11 #ifndef _TAPE_STD_H
12 #define _TAPE_STD_H
13
14 #include <asm/tape390.h>
15
16
17
18
19
20 #define MAX_BLOCKSIZE 65535
21
22
23
24
25 #define INVALID_00 0x00
26 #define BACKSPACEBLOCK 0x27
27 #define BACKSPACEFILE 0x2f
28 #define DATA_SEC_ERASE 0x97
29 #define ERASE_GAP 0x17
30 #define FORSPACEBLOCK 0x37
31 #define FORSPACEFILE 0x3F
32 #define FORCE_STREAM_CNT 0xEB
33 #define NOP 0x03
34 #define READ_FORWARD 0x02
35 #define REWIND 0x07
36 #define REWIND_UNLOAD 0x0F
37 #define SENSE 0x04
38 #define NEW_MODE_SET 0xEB
39 #define WRITE_CMD 0x01
40 #define WRITETAPEMARK 0x1F
41
42 #define ASSIGN 0xB7
43 #define CONTROL_ACCESS 0xE3
44 #define DIAG_MODE_SET 0x0B
45 #define LOAD_DISPLAY 0x9F
46 #define LOCATE 0x4F
47 #define LOOP_WRITE_TO_READ 0x8B
48 #define MODE_SET_DB 0xDB
49 #define MODE_SET_C3 0xC3
50 #define MODE_SET_CB 0xCB
51 #define MODE_SET_D3 0xD3
52 #define READ_BACKWARD 0x0C
53 #define READ_BLOCK_ID 0x22
54 #define READ_BUFFER 0x12
55 #define READ_BUFF_LOG 0x24
56 #define RELEASE 0xD4
57 #define REQ_TRK_IN_ERROR 0x1B
58 #define RESERVE 0xF4
59 #define SENSE_GROUP_ID 0x34
60 #define SENSE_ID 0xE4
61 #define READ_DEV_CHAR 0x64
62 #define SET_DIAGNOSE 0x4B
63 #define SET_GROUP_ID 0xAF
64 #define SET_TAPE_WRITE_IMMED 0xC3
65 #define SUSPEND 0x5B
66 #define SYNC 0x43
67 #define UNASSIGN 0xC7
68 #define PERF_SUBSYS_FUNC 0x77
69 #define READ_CONFIG_DATA 0xFA
70 #define READ_MESSAGE_ID 0x4E
71 #define READ_SUBSYS_DATA 0x3E
72 #define SET_INTERFACE_ID 0x73
73
74 #define SENSE_COMMAND_REJECT 0x80
75 #define SENSE_INTERVENTION_REQUIRED 0x40
76 #define SENSE_BUS_OUT_CHECK 0x20
77 #define SENSE_EQUIPMENT_CHECK 0x10
78 #define SENSE_DATA_CHECK 0x08
79 #define SENSE_OVERRUN 0x04
80 #define SENSE_DEFERRED_UNIT_CHECK 0x02
81 #define SENSE_ASSIGNED_ELSEWHERE 0x01
82
83 #define SENSE_LOCATE_FAILURE 0x80
84 #define SENSE_DRIVE_ONLINE 0x40
85 #define SENSE_RESERVED 0x20
86 #define SENSE_RECORD_SEQUENCE_ERR 0x10
87 #define SENSE_BEGINNING_OF_TAPE 0x08
88 #define SENSE_WRITE_MODE 0x04
89 #define SENSE_WRITE_PROTECT 0x02
90 #define SENSE_NOT_CAPABLE 0x01
91
92 #define SENSE_CHANNEL_ADAPTER_CODE 0xE0
93 #define SENSE_CHANNEL_ADAPTER_LOC 0x10
94 #define SENSE_REPORTING_CU 0x08
95 #define SENSE_AUTOMATIC_LOADER 0x04
96 #define SENSE_TAPE_SYNC_MODE 0x02
97 #define SENSE_TAPE_POSITIONING 0x01
98
99
100 struct tape_request *tape_std_read_block(struct tape_device *, size_t);
101 void tape_std_read_backward(struct tape_device *device,
102 struct tape_request *request);
103 struct tape_request *tape_std_write_block(struct tape_device *, size_t);
104 void tape_std_check_locate(struct tape_device *, struct tape_request *);
105
106
107 int tape_std_assign(struct tape_device *);
108 int tape_std_unassign(struct tape_device *);
109 int tape_std_read_block_id(struct tape_device *device, __u64 *id);
110 int tape_std_display(struct tape_device *, struct display_struct *disp);
111 int tape_std_terminate_write(struct tape_device *);
112
113
114 int tape_std_mtbsf(struct tape_device *, int);
115 int tape_std_mtbsfm(struct tape_device *, int);
116 int tape_std_mtbsr(struct tape_device *, int);
117 int tape_std_mtcompression(struct tape_device *, int);
118 int tape_std_mteom(struct tape_device *, int);
119 int tape_std_mterase(struct tape_device *, int);
120 int tape_std_mtfsf(struct tape_device *, int);
121 int tape_std_mtfsfm(struct tape_device *, int);
122 int tape_std_mtfsr(struct tape_device *, int);
123 int tape_std_mtload(struct tape_device *, int);
124 int tape_std_mtnop(struct tape_device *, int);
125 int tape_std_mtoffl(struct tape_device *, int);
126 int tape_std_mtreset(struct tape_device *, int);
127 int tape_std_mtreten(struct tape_device *, int);
128 int tape_std_mtrew(struct tape_device *, int);
129 int tape_std_mtsetblk(struct tape_device *, int);
130 int tape_std_mtunload(struct tape_device *, int);
131 int tape_std_mtweof(struct tape_device *, int);
132
133
134 void tape_std_default_handler(struct tape_device *);
135 void tape_std_unexpect_uchk_handler(struct tape_device *);
136 void tape_std_irq(struct tape_device *);
137 void tape_std_process_eov(struct tape_device *);
138
139
140 void tape_std_error_recovery(struct tape_device *);
141 void tape_std_error_recovery_has_failed(struct tape_device *,int error_id);
142 void tape_std_error_recovery_succeded(struct tape_device *);
143 void tape_std_error_recovery_do_retry(struct tape_device *);
144 void tape_std_error_recovery_read_opposite(struct tape_device *);
145 void tape_std_error_recovery_HWBUG(struct tape_device *, int condno);
146
147
148 enum s390_tape_type {
149 tape_3480,
150 tape_3490,
151 tape_3590,
152 tape_3592,
153 };
154
155 #endif