Skip to content

Commit 0971dec

Browse files
authored
Support LTOA (#507)
1 parent d8c223b commit 0971dec

File tree

7 files changed

+190
-8
lines changed

7 files changed

+190
-8
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, 2023 IBM Corp. All rights reserved.
6+
** Copyright 2010, 2025 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
@@ -155,6 +155,8 @@ enum {
155155
TC_DC_LTOM8 = 0x5D,
156156
TC_DC_LTO8 = 0x5E,
157157
TC_DC_LTO9 = 0x60,
158+
TC_DC_LTOA = 0x62,
159+
TC_DC_LTOPA = 0x63,
158160
};
159161

160162
/* Density codes of TS11x0 */

src/tape_drivers/generic/file/filedebug_tc.c

Lines changed: 15 additions & 2 deletions
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, 2025 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
@@ -1340,7 +1340,20 @@ static inline int _sanitize_tape(struct filedebug_data *state)
13401340
ret = -EDEV_MEDIUM_FORMAT_ERROR;
13411341
break;
13421342
}
1343-
} else if (gen == DRIVE_GEN_JAG4) {
1343+
} else if (gen == DRIVE_GEN_LTOA) {
1344+
switch (state->conf.cart_type) {
1345+
case TC_MP_LTOPAD_CART:
1346+
case TC_MP_LTOAD_CART:
1347+
/* Do nothing */
1348+
break;
1349+
default:
1350+
ltfsmsg(LTFS_INFO, 30086I, "LTOA", state->conf.cart_type);
1351+
state->unsupported_tape = true;
1352+
ret = -EDEV_MEDIUM_FORMAT_ERROR;
1353+
break;
1354+
}
1355+
}
1356+
else if (gen == DRIVE_GEN_JAG4) {
13441357
switch (state->conf.cart_type) {
13451358
case TC_MP_JB:
13461359
case TC_MP_JC:

src/tape_drivers/hp_tape.c

Lines changed: 47 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, 2025 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
@@ -226,6 +226,26 @@ static struct _timeout_tape timeout_lto9[] = {
226226
{-1, -1}
227227
};
228228

229+
static struct _timeout_tape timeout_ltoA[] = {
230+
{ ERASE, 16320 },
231+
{ FORMAT_MEDIUM, 3180 },
232+
{ LOAD_UNLOAD, 780 },
233+
{ LOCATE10, 2940 },
234+
{ LOCATE16, 2940 },
235+
{ READ, 2340 },
236+
{ READ_BUFFER, 480 },
237+
{ REWIND, 600 },
238+
{ SEND_DIAGNOSTIC, 1980 },
239+
{ SET_CAPACITY, 780 },
240+
{ SPACE6, 2940 },
241+
{ SPACE16, 2940 },
242+
{ VERIFY, 104880 },
243+
{ WRITE, 1500 },
244+
{ WRITE_BUFFER, 540 },
245+
{ WRITE_FILEMARKS6, 1620 },
246+
{-1, -1}
247+
};
248+
229249
static struct _timeout_tape timeout_lto5_hh[] = {
230250
{ ERASE, 18000 },
231251
{ FORMAT_MEDIUM, 1560 },
@@ -326,6 +346,26 @@ static struct _timeout_tape timeout_lto9_hh[] = {
326346
{-1, -1}
327347
};
328348

349+
static struct _timeout_tape timeout_ltoA_hh[] = {
350+
{ ERASE, 166370 },
351+
{ FORMAT_MEDIUM, 3240 },
352+
{ LOAD_UNLOAD, 960 },
353+
{ LOCATE10, 3940 },
354+
{ LOCATE16, 3940 },
355+
{ READ, 2340 },
356+
{ READ_BUFFER, 480 },
357+
{ REWIND, 600 },
358+
{ SEND_DIAGNOSTIC, 2040 },
359+
{ SET_CAPACITY, 960 },
360+
{ SPACE6, 3940 },
361+
{ SPACE16, 3940 },
362+
{ VERIFY, 63300 },
363+
{ WRITE, 1560 },
364+
{ WRITE_BUFFER, 540 },
365+
{ WRITE_FILEMARKS6, 1680 },
366+
{-1, -1}
367+
};
368+
329369
static int _create_table_tape(struct timeout_tape **result,
330370
struct _timeout_tape* base,
331371
struct _timeout_tape* override)
@@ -402,6 +442,12 @@ int hp_tape_init_timeout(struct timeout_tape** table, int type)
402442
case DRIVE_LTO9_HH:
403443
ret = _create_table_tape(table, timeout_lto, timeout_lto9_hh);
404444
break;
445+
case DRIVE_LTOA:
446+
ret = _create_table_tape(table, timeout_lto, timeout_ltoA);
447+
break;
448+
case DRIVE_LTOA_HH:
449+
ret = _create_table_tape(table, timeout_lto, timeout_ltoA_hh);
450+
break;
405451
default:
406452
ret = _create_table_tape(table, timeout_lto, timeout_lto7_hh);
407453
break;

src/tape_drivers/ibm_tape.c

Lines changed: 87 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
** OO_Copyright_BEGIN
44
**
55
**
6-
** Copyright 2010, 2023 IBM Corp. All rights reserved.
6+
** Copyright 2010, 2025 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
@@ -193,6 +193,11 @@ DRIVE_DENSITY_SUPPORT_MAP jaguar_drive_density_strict[] = {
193193
};
194194

195195
DRIVE_DENSITY_SUPPORT_MAP lto_drive_density[] = {
196+
/* LTOA */
197+
{ DRIVE_GEN_LTOA, TC_MP_LTOPAD_CART, TC_DC_LTOPA, MEDIUM_PERFECT_MATCH},
198+
{ DRIVE_GEN_LTOA, TC_MP_LTOAD_CART, TC_DC_LTOA, MEDIUM_PERFECT_MATCH},
199+
{ DRIVE_GEN_LTOA, TC_MP_LTOAD_CART, TC_DC_UNKNOWN, MEDIUM_PERFECT_MATCH},
200+
{ DRIVE_GEN_LTOA, TC_MP_LTOPAD_CART, TC_DC_UNKNOWN, MEDIUM_PERFECT_MATCH},
196201
/* LTO9 */
197202
{ DRIVE_GEN_LTO9, TC_MP_LTO9D_CART, TC_DC_LTO9, MEDIUM_PERFECT_MATCH},
198203
{ DRIVE_GEN_LTO9, TC_MP_LTO9D_CART, TC_DC_UNKNOWN, MEDIUM_PERFECT_MATCH},
@@ -226,6 +231,12 @@ DRIVE_DENSITY_SUPPORT_MAP lto_drive_density[] = {
226231
};
227232

228233
DRIVE_DENSITY_SUPPORT_MAP lto_drive_density_strict[] = {
234+
/* LTOA */
235+
{ DRIVE_GEN_LTOA, TC_MP_LTOPAD_CART, TC_DC_LTOPA, MEDIUM_PERFECT_MATCH},
236+
{ DRIVE_GEN_LTOA, TC_MP_LTOAD_CART, TC_DC_LTOA, MEDIUM_PERFECT_MATCH},
237+
{ DRIVE_GEN_LTOA, TC_MP_LTOAD_CART, TC_DC_UNKNOWN, MEDIUM_PERFECT_MATCH},
238+
{ DRIVE_GEN_LTOA, TC_MP_LTOPAD_CART, TC_DC_UNKNOWN, MEDIUM_PERFECT_MATCH},
239+
229240
/* LTO9 */
230241
{ DRIVE_GEN_LTO9, TC_MP_LTO9D_CART, TC_DC_LTO9, MEDIUM_PERFECT_MATCH},
231242
{ DRIVE_GEN_LTO9, TC_MP_LTO9D_CART, TC_DC_UNKNOWN, MEDIUM_PERFECT_MATCH},
@@ -249,6 +260,8 @@ DRIVE_DENSITY_SUPPORT_MAP lto_drive_density_strict[] = {
249260
};
250261

251262
const unsigned char supported_cart[] = {
263+
TC_MP_LTOPAD_CART,
264+
TC_MP_LTOAD_CART,
252265
TC_MP_LTO9D_CART,
253266
TC_MP_LTO8D_CART,
254267
TC_MP_LTO7D_CART,
@@ -278,6 +291,8 @@ const unsigned char supported_density[] = {
278291
TC_DC_JAG5A,
279292
TC_DC_JAG5,
280293
TC_DC_JAG4,
294+
TC_DC_LTOPA,
295+
TC_DC_LTOA,
281296
TC_DC_LTO9,
282297
TC_DC_LTO8,
283298
TC_DC_LTOM8,
@@ -319,6 +334,10 @@ struct supported_device *ibm_supported_drives[] = {
319334
TAPEDRIVE( IBM_VENDOR_ID, "ULTRIUM-HH9", DRIVE_LTO9_HH, "[ULTRIUM-HH9]" ), /* IBM Ultrium Gen 9 Half-High */
320335
TAPEDRIVE( IBM_VENDOR_ID, "ULT3580-HH9", DRIVE_LTO9_HH, "[ULT3580-HH9]" ), /* IBM Ultrium Gen 9 Half-High */
321336
TAPEDRIVE( IBM_VENDOR_ID, "HH LTO Gen 9", DRIVE_LTO9_HH, "[HH LTO Gen 9]" ), /* IBM Ultrium Gen 9 Half-High */
337+
TAPEDRIVE( IBM_VENDOR_ID, "ULTRIUM-TDA", DRIVE_LTOA, "[ULTRIUM-TDA]" ), /* IBM Ultrium Gen A */
338+
TAPEDRIVE( IBM_VENDOR_ID, "ULT3580-TDA", DRIVE_LTOA, "[ULT3580-TDA]"), /* IBM Ultrium Gen A */
339+
TAPEDRIVE( IBM_VENDOR_ID, "ULTRIUM-HHA", DRIVE_LTOA_HH, "[ULTRIUM-HHA]"), /* IBM Ultrium Gen A Half-High */
340+
TAPEDRIVE( IBM_VENDOR_ID, "ULT3580-HHA", DRIVE_LTOA_HH, "[ULT3580-HHA]"), /* IBM Ultrium Gen A Half-High */
322341
TAPEDRIVE( IBM_VENDOR_ID, "03592E07", DRIVE_TS1140, "[03592E07]" ), /* IBM TS1140 */
323342
TAPEDRIVE( IBM_VENDOR_ID, "03592E08", DRIVE_TS1150, "[03592E08]" ), /* IBM TS1150 */
324343
TAPEDRIVE( IBM_VENDOR_ID, "0359255F", DRIVE_TS1155, "[0359255F]" ), /* IBM TS1155 */
@@ -348,6 +367,9 @@ struct supported_device *usb_supported_drives[] = {
348367
TAPEDRIVE( IBM_VENDOR_ID, "ULT3580-TD9", DRIVE_LTO9, "[ULT3580-TD9]" ), /* IBM Ultrium Gen 9 */
349368
TAPEDRIVE( IBM_VENDOR_ID, "ULTRIUM-HH9", DRIVE_LTO9_HH, "[ULTRIUM-HH9]" ), /* IBM Ultrium Gen 9 Half-High */
350369
TAPEDRIVE( IBM_VENDOR_ID, "ULT3580-HH9", DRIVE_LTO9_HH, "[ULT3580-HH9]" ), /* IBM Ultrium Gen 9 Half-High */
370+
TAPEDRIVE( IBM_VENDOR_ID, "ULT3580-TDA", DRIVE_LTOA, "[ULT3580-TDA]"), /* IBM Ultrium Gen A */
371+
TAPEDRIVE( IBM_VENDOR_ID, "ULTRIUM-HHA", DRIVE_LTOA_HH, "[ULTRIUM-HHA]" ), /* IBM Ultrium Gen A */
372+
TAPEDRIVE( IBM_VENDOR_ID, "ULT3580-HHA", DRIVE_LTOA_HH, "[ULT3580-HHA]" ), /* IBM Ultrium Gen A Half-High */
351373
/* End of supported_devices */
352374
NULL
353375
};
@@ -589,6 +611,26 @@ static struct _timeout_tape timeout_lto9[] = {
589611
{-1, -1}
590612
};
591613

614+
static struct _timeout_tape timeout_ltoA[] = {
615+
{ ERASE, 16320 },
616+
{ FORMAT_MEDIUM, 3180 },
617+
{ LOAD_UNLOAD, 780 },
618+
{ LOCATE10, 2940 },
619+
{ LOCATE16, 2940 },
620+
{ READ, 2340 },
621+
{ READ_BUFFER, 480 },
622+
{ REWIND, 600 },
623+
{ SEND_DIAGNOSTIC, 1980 },
624+
{ SET_CAPACITY, 780 },
625+
{ SPACE6, 2940 },
626+
{ SPACE16, 2940 },
627+
{ VERIFY, 104880 },
628+
{ WRITE, 1500 },
629+
{ WRITE_BUFFER, 540 },
630+
{ WRITE_FILEMARKS6, 1620 },
631+
{-1, -1}
632+
};
633+
592634
static struct _timeout_tape timeout_lto5_hh[] = {
593635
{ ERASE, 19200 },
594636
{ FORMAT_MEDIUM, 1980 },
@@ -689,6 +731,26 @@ static struct _timeout_tape timeout_lto9_hh[] = {
689731
{-1, -1}
690732
};
691733

734+
static struct _timeout_tape timeout_ltoA_hh[] = {
735+
{ ERASE, 166370 },
736+
{ FORMAT_MEDIUM, 3240 },
737+
{ LOAD_UNLOAD, 960 },
738+
{ LOCATE10, 3940 },
739+
{ LOCATE16, 3940 },
740+
{ READ, 2340 },
741+
{ READ_BUFFER, 480 },
742+
{ REWIND, 600 },
743+
{ SEND_DIAGNOSTIC, 2040 },
744+
{ SET_CAPACITY, 960 },
745+
{ SPACE6, 3940 },
746+
{ SPACE16, 3940 },
747+
{ VERIFY, 63300 },
748+
{ WRITE, 1560 },
749+
{ WRITE_BUFFER, 540 },
750+
{ WRITE_FILEMARKS6, 1680 },
751+
{-1, -1}
752+
};
753+
692754
static struct _timeout_tape timeout_11x0[] = {
693755
{ CHANGE_DEFINITION, 30 },
694756
{ INQUIRY, 30 },
@@ -903,6 +965,12 @@ int ibm_tape_init_timeout(struct timeout_tape** table, int type)
903965
case DRIVE_LTO9_HH:
904966
ret = _create_table_tape(table, timeout_lto, timeout_lto9_hh);
905967
break;
968+
case DRIVE_LTOA:
969+
ret = _create_table_tape(table, timeout_lto, timeout_ltoA);
970+
break;
971+
case DRIVE_LTOA_HH:
972+
ret = _create_table_tape(table, timeout_lto, timeout_ltoA_hh);
973+
break;
906974
case DRIVE_TS1140:
907975
ret = _create_table_tape(table, timeout_11x0, timeout_1140);
908976
break;
@@ -989,6 +1057,9 @@ static inline unsigned char _assume_cartridge_type(char product, char btype)
9891057
case '9':
9901058
ctype = TC_MP_LTO9D_CART;
9911059
break;
1060+
case 'A':
1061+
ctype = TC_MP_LTOAD_CART;
1062+
break;
9921063
default:
9931064
break;
9941065
}
@@ -1001,6 +1072,15 @@ static inline unsigned char _assume_cartridge_type(char product, char btype)
10011072
break;
10021073
}
10031074
}
1075+
else if (product == 'P') {
1076+
switch (btype) {
1077+
case 'A':
1078+
ctype = TC_MP_LTOPAD_CART;
1079+
break;
1080+
default:
1081+
break;
1082+
}
1083+
}
10041084

10051085
return ctype;
10061086
}
@@ -1039,6 +1119,12 @@ char* ibm_tape_assume_cart_name(unsigned char type)
10391119
case TC_MP_LTO9D_CART:
10401120
name = "L9";
10411121
break;
1122+
case TC_MP_LTOAD_CART:
1123+
name = "LA";
1124+
break;
1125+
case TC_MP_LTOPAD_CART:
1126+
name = "PA";
1127+
break;
10421128
case TC_MP_JB:
10431129
name = "JB";
10441130
break;

src/tape_drivers/quantum_tape.c

Lines changed: 24 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, 2025 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
@@ -246,6 +246,26 @@ static struct _timeout_tape timeout_lto9_hh[] = {
246246
{-1, -1}
247247
};
248248

249+
static struct _timeout_tape timeout_ltoA_hh[] = {
250+
{ ERASE, 166370 },
251+
{ FORMAT_MEDIUM, 3240 },
252+
{ LOAD_UNLOAD, 960 },
253+
{ LOCATE10, 3940 },
254+
{ LOCATE16, 3940 },
255+
{ READ, 2340 },
256+
{ READ_BUFFER, 480 },
257+
{ REWIND, 600 },
258+
{ SEND_DIAGNOSTIC, 2040 },
259+
{ SET_CAPACITY, 960 },
260+
{ SPACE6, 3940 },
261+
{ SPACE16, 3940 },
262+
{ VERIFY, 63300 },
263+
{ WRITE, 1560 },
264+
{ WRITE_BUFFER, 540 },
265+
{ WRITE_FILEMARKS6, 1680 },
266+
{-1, -1}
267+
};
268+
249269
static int _create_table_tape(struct timeout_tape **result,
250270
struct _timeout_tape* base,
251271
struct _timeout_tape* override)
@@ -307,6 +327,9 @@ int quantum_tape_init_timeout(struct timeout_tape** table, int type)
307327
case DRIVE_LTO9_HH:
308328
ret = _create_table_tape(table, timeout_lto, timeout_lto9_hh);
309329
break;
330+
case DRIVE_LTOA_HH:
331+
ret = _create_table_tape(table, timeout_lto, timeout_ltoA_hh);
332+
break;
310333
default:
311334
ret = _create_table_tape(table, timeout_lto, timeout_lto7_hh);
312335
break;

src/tape_drivers/tape_drivers.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
** OO_Copyright_BEGIN
44
**
55
**
6-
** Copyright 2010, 2023 IBM Corp. All rights reserved.
6+
** Copyright 2010, 2025 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
@@ -193,6 +193,8 @@ enum {
193193
DRIVE_LTO8_HH = 0x2208, /* Ultrium Gen 8 Half-High */
194194
DRIVE_LTO9 = 0x2109, /* Ultrium Gen 9 */
195195
DRIVE_LTO9_HH = 0x2209, /* Ultrium Gen 9 Half-High */
196+
DRIVE_LTOA = 0x210A, /* Ultrium Gen A */
197+
DRIVE_LTOA_HH = 0x220A, /* Ultrium Gen A Half-High */
196198
DRIVE_TS1140 = 0x1104, /* TS1140 */
197199
DRIVE_TS1150 = 0x1105, /* TS1150 */
198200
DRIVE_TS1155 = 0x5105, /* TS1155 */
@@ -207,6 +209,7 @@ enum {
207209
DRIVE_GEN_LTO7 = 0x2007,
208210
DRIVE_GEN_LTO8 = 0x2008,
209211
DRIVE_GEN_LTO9 = 0x2009,
212+
DRIVE_GEN_LTOA = 0x200A,
210213
DRIVE_GEN_JAG4 = 0x1004,
211214
DRIVE_GEN_JAG5 = 0x1005,
212215
DRIVE_GEN_JAG5A = 0x5005,
@@ -225,13 +228,16 @@ enum {
225228
TC_MP_LTO7D_CART = 0x78, /* LTO7 Data cartridge */
226229
TC_MP_LTO8D_CART = 0x88, /* LTO8 Data cartridge */
227230
TC_MP_LTO9D_CART = 0x98, /* LTO9 Data cartridge */
231+
TC_MP_LTOAD_CART = 0xA8, /* LTOA Data cartridge */
232+
TC_MP_LTOPAD_CART = 0xA9, /* LTOPA Data cartridge */
228233
TC_MP_LTO3W_CART = 0x3C, /* LTO3 WORM cartridge */
229234
TC_MP_LTO4W_CART = 0x4C, /* LTO4 WORM cartridge */
230235
TC_MP_LTO5W_CART = 0x5C, /* LTO5 WORM cartridge */
231236
TC_MP_LTO6W_CART = 0x6C, /* LTO6 WORM cartridge */
232237
TC_MP_LTO7W_CART = 0x7C, /* LTO7 WORM cartridge */
233238
TC_MP_LTO8W_CART = 0x8C, /* LTO8 WORM cartridge */
234239
TC_MP_LTO9W_CART = 0x9C, /* LTO9 WORM cartridge */
240+
TC_MP_LTOAW_CART = 0xAC, /* LTOA WORM cartridge */
235241
};
236242

237243
/* Enterprise cartridge type in mode page header */

0 commit comments

Comments
 (0)