Skip to content

Commit 9ab1dc5

Browse files
authored
Linux Jaguar 7 Tape and TS1170 Drive Support (#423)
1 parent 7d5c5af commit 9ab1dc5

File tree

4 files changed

+76
-3
lines changed

4 files changed

+76
-3
lines changed

src/libltfs/tape_ops.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
** OO_Copyright_BEGIN
44
**
55
**
6-
** Copyright 2010, 2020 IBM Corp. All rights reserved.
6+
** Copyright 2010, 2023 IBM Corp. All rights reserved.
77
**
88
** Redistribution and use in source and binary forms, with or without
99
** modification, are permitted provided that the following conditions
@@ -166,13 +166,15 @@ enum {
166166
TC_DC_JAG5 = 0x55,
167167
TC_DC_JAG5A = 0x56,
168168
TC_DC_JAG6 = 0x57,
169+
TC_DC_JAG7 = 0x59,
169170
TC_DC_JAG1E = 0x71,
170171
TC_DC_JAG2E = 0x72,
171172
TC_DC_JAG3E = 0x73,
172173
TC_DC_JAG4E = 0x74,
173174
TC_DC_JAG5E = 0x75,
174175
TC_DC_JAG5AE = 0x76,
175176
TC_DC_JAG6E = 0x77,
177+
TC_DC_JAG7E = 0x79,
176178
};
177179

178180
#define ALL_MEDIA_DENSITY 0

src/tape_drivers/generic/file/filedebug_tc.c

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1418,6 +1418,23 @@ static inline int _sanitize_tape(struct filedebug_data *state)
14181418
ret = -EDEV_MEDIUM_FORMAT_ERROR;
14191419
break;
14201420
}
1421+
} else if (gen == DRIVE_GEN_JAG7) {
1422+
switch (state->conf.cart_type) {
1423+
case TC_MP_JE:
1424+
case TC_MP_JM:
1425+
case TC_MP_JF:
1426+
state->is_worm = false;
1427+
break;
1428+
case TC_MP_JV:
1429+
state->is_worm = true;
1430+
break;
1431+
default:
1432+
ltfsmsg(LTFS_INFO, 30086I, "TS1170", state->conf.cart_type);
1433+
state->is_worm = false;
1434+
state->unsupported_tape = true;
1435+
ret = -EDEV_MEDIUM_FORMAT_ERROR;
1436+
break;
1437+
}
14211438
} else {
14221439
ltfsmsg(LTFS_INFO, 30086I, "Unexpected Drive", state->conf.cart_type);
14231440
state->is_worm = false;

src/tape_drivers/ibm_tape.c

Lines changed: 50 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
** OO_Copyright_BEGIN
44
**
55
**
6-
** Copyright 2010, 2020 IBM Corp. All rights reserved.
6+
** Copyright 2010, 2023 IBM Corp. All rights reserved.
77
**
88
** Redistribution and use in source and binary forms, with or without
99
** modification, are permitted provided that the following conditions
@@ -64,6 +64,16 @@
6464
#include "libltfs/ltfs_endian.h"
6565

6666
DRIVE_DENSITY_SUPPORT_MAP jaguar_drive_density[] = {
67+
/* TS1170 */
68+
{ DRIVE_GEN_JAG7, TC_MP_JF, TC_DC_JAG7, MEDIUM_PERFECT_MATCH },
69+
{ DRIVE_GEN_JAG7, TC_MP_JF, TC_DC_UNKNOWN, MEDIUM_PROBABLY_WRITABLE },
70+
{ DRIVE_GEN_JAG7, TC_MP_JE, TC_DC_JAG6, MEDIUM_WRITABLE },
71+
{ DRIVE_GEN_JAG7, TC_MP_JE, TC_DC_UNKNOWN, MEDIUM_WRITABLE },
72+
{ DRIVE_GEN_JAG7, TC_MP_JV, TC_DC_JAG6, MEDIUM_WRITABLE },
73+
{ DRIVE_GEN_JAG7, TC_MP_JV, TC_DC_UNKNOWN, MEDIUM_WRITABLE },
74+
{ DRIVE_GEN_JAG7, TC_MP_JM, TC_DC_JAG6, MEDIUM_WRITABLE },
75+
{ DRIVE_GEN_JAG7, TC_MP_JM, TC_DC_UNKNOWN, MEDIUM_WRITABLE },
76+
6777
/* TS1160 */
6878
{ DRIVE_GEN_JAG6, TC_MP_JE, TC_DC_JAG6, MEDIUM_PERFECT_MATCH },
6979
{ DRIVE_GEN_JAG6, TC_MP_JE, TC_DC_UNKNOWN, MEDIUM_PROBABLY_WRITABLE },
@@ -141,6 +151,10 @@ DRIVE_DENSITY_SUPPORT_MAP jaguar_drive_density[] = {
141151
};
142152

143153
DRIVE_DENSITY_SUPPORT_MAP jaguar_drive_density_strict[] = {
154+
/* TS1170 */
155+
{ DRIVE_GEN_JAG7, TC_MP_JF, TC_DC_JAG7, MEDIUM_PERFECT_MATCH },
156+
{ DRIVE_GEN_JAG7, TC_MP_JF, TC_DC_UNKNOWN, MEDIUM_PROBABLY_WRITABLE },
157+
144158
/* TS1160 */
145159
{ DRIVE_GEN_JAG6, TC_MP_JE, TC_DC_JAG6, MEDIUM_PERFECT_MATCH },
146160
{ DRIVE_GEN_JAG6, TC_MP_JE, TC_DC_UNKNOWN, MEDIUM_PROBABLY_WRITABLE },
@@ -256,13 +270,16 @@ const unsigned char supported_cart[] = {
256270
TC_MP_JE,
257271
TC_MP_JV,
258272
TC_MP_JM,
273+
TC_MP_JF,
259274
};
260275

261276
const unsigned char supported_density[] = {
277+
TC_DC_JAG7E,
262278
TC_DC_JAG6E,
263279
TC_DC_JAG5AE,
264280
TC_DC_JAG5E,
265281
TC_DC_JAG4E,
282+
TC_DC_JAG7,
266283
TC_DC_JAG6,
267284
TC_DC_JAG5A,
268285
TC_DC_JAG5,
@@ -315,6 +332,8 @@ struct supported_device *ibm_supported_drives[] = {
315332
TAPEDRIVE( IBM_VENDOR_ID, "0359260F", DRIVE_TS1160, "[0359260F]" ), /* IBM TS1160 */
316333
TAPEDRIVE( IBM_VENDOR_ID, "0359260E", DRIVE_TS1160, "[0359260E]" ), /* IBM TS1160 */
317334
TAPEDRIVE( IBM_VENDOR_ID, "0359260S", DRIVE_TS1160, "[0359260S]" ), /* IBM TS1160 */
335+
TAPEDRIVE( IBM_VENDOR_ID, "0359270F", DRIVE_TS1170, "[0359270F]" ), /* IBM TS1170 */
336+
TAPEDRIVE( IBM_VENDOR_ID, "0359270S", DRIVE_TS1170, "[0359270S]" ), /* IBM TS1170 */
318337
/* End of supported_devices */
319338
NULL
320339
};
@@ -794,6 +813,26 @@ static struct _timeout_tape timeout_1160[] = {
794813
{-1, -1}
795814
};
796815

816+
static struct _timeout_tape timeout_1170[] = {
817+
{ XCOPY, 176820 },
818+
{ ERASE, 175900 },
819+
{ FORMAT_MEDIUM, 3120 },
820+
{ LOAD_UNLOAD, 900 },
821+
{ LOCATE10, 2280 },
822+
{ LOCATE16, 2240 },
823+
{ READ, 2340 },
824+
{ READ_BUFFER, 480 },
825+
{ REWIND, 600 },
826+
{ SEND_DIAGNOSTIC, 2280 },
827+
{ SPACE6, 2280 },
828+
{ SPACE16, 2240 },
829+
{ VERIFY, 176820 },
830+
{ WRITE, 1440 },
831+
{ WRITE_BUFFER, 540 },
832+
{ WRITE_FILEMARKS6, 1380 },
833+
{-1, -1}
834+
};
835+
797836
static int _create_table_tape(struct timeout_tape **result,
798837
struct _timeout_tape* base,
799838
struct _timeout_tape* override)
@@ -882,6 +921,9 @@ int ibm_tape_init_timeout(struct timeout_tape** table, int type)
882921
case DRIVE_TS1160:
883922
ret = _create_table_tape(table, timeout_11x0, timeout_1160);
884923
break;
924+
case DRIVE_TS1170:
925+
ret = _create_table_tape(table, timeout_11x0, timeout_1170);
926+
break;
885927
default:
886928
ret = _create_table_tape(table, timeout_lto, timeout_lto7_hh);
887929
break;
@@ -930,6 +972,9 @@ static inline unsigned char _assume_cartridge_type(char product, char btype)
930972
case 'M':
931973
ctype = TC_MP_JM;
932974
break;
975+
case 'F':
976+
ctype = TC_MP_JF;
977+
break;
933978
default:
934979
break;
935980
}
@@ -1033,6 +1078,9 @@ char* ibm_tape_assume_cart_name(unsigned char type)
10331078
case TC_MP_JM:
10341079
name = "JM";
10351080
break;
1081+
case TC_MP_JF:
1082+
name = "JF";
1083+
break;
10361084
default:
10371085
name = "L5";
10381086
break;
@@ -1295,6 +1343,7 @@ bool ibm_tape_is_supported_firmware(int drive_type, const unsigned char * const
12951343
case DRIVE_LTO7_HH:
12961344
case DRIVE_TS1150:
12971345
case DRIVE_TS1160:
1346+
case DRIVE_TS1170:
12981347
default:
12991348
break;
13001349
}

src/tape_drivers/tape_drivers.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
** OO_Copyright_BEGIN
44
**
55
**
6-
** Copyright 2010, 2020 IBM Corp. All rights reserved.
6+
** Copyright 2010, 2023 IBM Corp. All rights reserved.
77
**
88
** Redistribution and use in source and binary forms, with or without
99
** modification, are permitted provided that the following conditions
@@ -197,6 +197,7 @@ enum {
197197
DRIVE_TS1150 = 0x1105, /* TS1150 */
198198
DRIVE_TS1155 = 0x5105, /* TS1155 */
199199
DRIVE_TS1160 = 0x1106, /* TS1160 */
200+
DRIVE_TS1170 = 0x1107, /* TS1170 */
200201
};
201202

202203
enum {
@@ -210,6 +211,7 @@ enum {
210211
DRIVE_GEN_JAG5 = 0x1005,
211212
DRIVE_GEN_JAG5A = 0x5005,
212213
DRIVE_GEN_JAG6 = 0x1006,
214+
DRIVE_GEN_JAG7 = 0x1007,
213215
};
214216

215217
/* LTO cartridge type in mode page header */
@@ -254,6 +256,8 @@ enum {
254256
TC_MP_JE = 0x95, /* IBM TS11x0 JE cartridge */
255257
TC_MP_JV = 0xA5, /* IBM TS11x0 JV cartridge */
256258
TC_MP_JM = 0xB4, /* IBM TS11x0 JM cartridge */
259+
/* 6th gen */
260+
TC_MP_JF = 0x96, /* IBM TS11x0 JF cartridge */
257261
};
258262

259263
#define IS_REFORMATTABLE_TAPE(t) \
@@ -268,6 +272,7 @@ enum {
268272
t == TC_MP_JE || \
269273
t == TC_MP_JV || \
270274
t == TC_MP_JM || \
275+
t == TC_MP_JF || \
271276
t == TC_MP_LTO7D_CART )
272277

273278
#endif // __tape_drivers_h

0 commit comments

Comments
 (0)