Skip to content

Commit f00cf52

Browse files
author
josue-morfin
committed
support LTOA
1 parent d8c223b commit f00cf52

7 files changed

Lines changed: 182 additions & 1 deletion

File tree

src/libltfs/tape_ops.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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, 104880 },
234+
{ LOCATE16, 104880 },
235+
{ READ, 2340 },
236+
{ READ_BUFFER, 480 },
237+
{ REWIND, 600 },
238+
{ SEND_DIAGNOSTIC, 1980 },
239+
{ SET_CAPACITY, 780 },
240+
{ SPACE6, 104880 },
241+
{ SPACE16, 104880 },
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, 205440 },
351+
{ FORMAT_MEDIUM, 3180 },
352+
{ LOAD_UNLOAD, 780 },
353+
{ LOCATE10, 104880 },
354+
{ LOCATE16, 104880 },
355+
{ READ, 2340 },
356+
{ READ_BUFFER, 480 },
357+
{ REWIND, 600 },
358+
{ SEND_DIAGNOSTIC, 1980 },
359+
{ SET_CAPACITY, 780 },
360+
{ SPACE6, 2940 },
361+
{ SPACE16, 2940 },
362+
{ VERIFY, 104880 },
363+
{ WRITE, 1500 },
364+
{ WRITE_BUFFER, 540 },
365+
{ WRITE_FILEMARKS6, 1620 },
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: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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+
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,11 @@ 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+
229239
/* LTO9 */
230240
{ DRIVE_GEN_LTO9, TC_MP_LTO9D_CART, TC_DC_LTO9, MEDIUM_PERFECT_MATCH},
231241
{ DRIVE_GEN_LTO9, TC_MP_LTO9D_CART, TC_DC_UNKNOWN, MEDIUM_PERFECT_MATCH},
@@ -249,6 +259,8 @@ DRIVE_DENSITY_SUPPORT_MAP lto_drive_density_strict[] = {
249259
};
250260

251261
const unsigned char supported_cart[] = {
262+
TC_MP_LTOPAD_CART,
263+
TC_MP_LTOAD_CART,
252264
TC_MP_LTO9D_CART,
253265
TC_MP_LTO8D_CART,
254266
TC_MP_LTO7D_CART,
@@ -278,6 +290,8 @@ const unsigned char supported_density[] = {
278290
TC_DC_JAG5A,
279291
TC_DC_JAG5,
280292
TC_DC_JAG4,
293+
TC_DC_LTOPA,
294+
TC_DC_LTOA,
281295
TC_DC_LTO9,
282296
TC_DC_LTO8,
283297
TC_DC_LTOM8,
@@ -319,6 +333,10 @@ struct supported_device *ibm_supported_drives[] = {
319333
TAPEDRIVE( IBM_VENDOR_ID, "ULTRIUM-HH9", DRIVE_LTO9_HH, "[ULTRIUM-HH9]" ), /* IBM Ultrium Gen 9 Half-High */
320334
TAPEDRIVE( IBM_VENDOR_ID, "ULT3580-HH9", DRIVE_LTO9_HH, "[ULT3580-HH9]" ), /* IBM Ultrium Gen 9 Half-High */
321335
TAPEDRIVE( IBM_VENDOR_ID, "HH LTO Gen 9", DRIVE_LTO9_HH, "[HH LTO Gen 9]" ), /* IBM Ultrium Gen 9 Half-High */
336+
TAPEDRIVE( IBM_VENDOR_ID, "ULTRIUM-TDA", DRIVE_LTOA, "[ULTRIUM-TDA]" ), /* IBM Ultrium Gen A */
337+
TAPEDRIVE( IBM_VENDOR_ID, "ULT3580-TDA", DRIVE_LTOA, "[ULT3580-TDA]"), /* IBM Ultrium Gen A */
338+
TAPEDRIVE( IBM_VENDOR_ID, "ULTRIUM-HHA", DRIVE_LTOA_HH, "[ULTRIUM-HHA]"), /* IBM Ultrium Gen A Half-High */
339+
TAPEDRIVE( IBM_VENDOR_ID, "ULT3580-HHA", DRIVE_LTOA_HH, "[ULT3580-HHA]"), /* IBM Ultrium Gen A Half-High */
322340
TAPEDRIVE( IBM_VENDOR_ID, "03592E07", DRIVE_TS1140, "[03592E07]" ), /* IBM TS1140 */
323341
TAPEDRIVE( IBM_VENDOR_ID, "03592E08", DRIVE_TS1150, "[03592E08]" ), /* IBM TS1150 */
324342
TAPEDRIVE( IBM_VENDOR_ID, "0359255F", DRIVE_TS1155, "[0359255F]" ), /* IBM TS1155 */
@@ -348,6 +366,9 @@ struct supported_device *usb_supported_drives[] = {
348366
TAPEDRIVE( IBM_VENDOR_ID, "ULT3580-TD9", DRIVE_LTO9, "[ULT3580-TD9]" ), /* IBM Ultrium Gen 9 */
349367
TAPEDRIVE( IBM_VENDOR_ID, "ULTRIUM-HH9", DRIVE_LTO9_HH, "[ULTRIUM-HH9]" ), /* IBM Ultrium Gen 9 Half-High */
350368
TAPEDRIVE( IBM_VENDOR_ID, "ULT3580-HH9", DRIVE_LTO9_HH, "[ULT3580-HH9]" ), /* IBM Ultrium Gen 9 Half-High */
369+
TAPEDRIVE( IBM_VENDOR_ID, "ULT3580-TDA", DRIVE_LTOA, "[ULT3580-TDA]"), /* IBM Ultrium Gen A */
370+
TAPEDRIVE( IBM_VENDOR_ID, "ULTRIUM-HHA", DRIVE_LTOA_HH, "[ULTRIUM-HHA]" ), /* IBM Ultrium Gen A */
371+
TAPEDRIVE( IBM_VENDOR_ID, "ULT3580-HHA", DRIVE_LTOA_HH, "[ULT3580-HHA]" ), /* IBM Ultrium Gen A Half-High */
351372
/* End of supported_devices */
352373
NULL
353374
};
@@ -589,6 +610,26 @@ static struct _timeout_tape timeout_lto9[] = {
589610
{-1, -1}
590611
};
591612

613+
static struct _timeout_tape timeout_ltoA[] = {
614+
{ ERASE, 16320 },
615+
{ FORMAT_MEDIUM, 3180 },
616+
{ LOAD_UNLOAD, 780 },
617+
{ LOCATE10, 104880 },
618+
{ LOCATE16, 104880 },
619+
{ READ, 2340 },
620+
{ READ_BUFFER, 480 },
621+
{ REWIND, 600 },
622+
{ SEND_DIAGNOSTIC, 1980 },
623+
{ SET_CAPACITY, 780 },
624+
{ SPACE6, 104880 },
625+
{ SPACE16, 104880 },
626+
{ VERIFY, 104880 },
627+
{ WRITE, 1500 },
628+
{ WRITE_BUFFER, 540 },
629+
{ WRITE_FILEMARKS6, 1620 },
630+
{-1, -1}
631+
};
632+
592633
static struct _timeout_tape timeout_lto5_hh[] = {
593634
{ ERASE, 19200 },
594635
{ FORMAT_MEDIUM, 1980 },
@@ -689,6 +730,26 @@ static struct _timeout_tape timeout_lto9_hh[] = {
689730
{-1, -1}
690731
};
691732

733+
static struct _timeout_tape timeout_ltoA_hh[] = {
734+
{ ERASE, 205440 },
735+
{ FORMAT_MEDIUM, 3180 },
736+
{ LOAD_UNLOAD, 780 },
737+
{ LOCATE10, 104880 },
738+
{ LOCATE16, 104880 },
739+
{ READ, 2340 },
740+
{ READ_BUFFER, 480 },
741+
{ REWIND, 600 },
742+
{ SEND_DIAGNOSTIC, 1980 },
743+
{ SET_CAPACITY, 780 },
744+
{ SPACE6, 2940 },
745+
{ SPACE16, 2940 },
746+
{ VERIFY, 104880 },
747+
{ WRITE, 1500 },
748+
{ WRITE_BUFFER, 540 },
749+
{ WRITE_FILEMARKS6, 1620 },
750+
{-1, -1}
751+
};
752+
692753
static struct _timeout_tape timeout_11x0[] = {
693754
{ CHANGE_DEFINITION, 30 },
694755
{ INQUIRY, 30 },
@@ -903,6 +964,12 @@ int ibm_tape_init_timeout(struct timeout_tape** table, int type)
903964
case DRIVE_LTO9_HH:
904965
ret = _create_table_tape(table, timeout_lto, timeout_lto9_hh);
905966
break;
967+
case DRIVE_LTOA:
968+
ret = _create_table_tape(table, timeout_lto, timeout_ltoA);
969+
break;
970+
case DRIVE_LTOA_HH:
971+
ret = _create_table_tape(table, timeout_lto, timeout_ltoA_hh);
972+
break;
906973
case DRIVE_TS1140:
907974
ret = _create_table_tape(table, timeout_11x0, timeout_1140);
908975
break;
@@ -989,6 +1056,9 @@ static inline unsigned char _assume_cartridge_type(char product, char btype)
9891056
case '9':
9901057
ctype = TC_MP_LTO9D_CART;
9911058
break;
1059+
case 'A':
1060+
ctype = TC_MP_LTOAD_CART;
1061+
break;
9921062
default:
9931063
break;
9941064
}
@@ -1001,6 +1071,15 @@ static inline unsigned char _assume_cartridge_type(char product, char btype)
10011071
break;
10021072
}
10031073
}
1074+
else if (product == 'P') {
1075+
switch (btype) {
1076+
case 'A':
1077+
ctype = TC_MP_LTOPAD_CART;
1078+
break;
1079+
default:
1080+
break;
1081+
}
1082+
}
10041083

10051084
return ctype;
10061085
}
@@ -1039,6 +1118,12 @@ char* ibm_tape_assume_cart_name(unsigned char type)
10391118
case TC_MP_LTO9D_CART:
10401119
name = "L9";
10411120
break;
1121+
case TC_MP_LTOAD_CART:
1122+
name = "LA";
1123+
break;
1124+
case TC_MP_LTOPAD_CART:
1125+
name = "PA";
1126+
break;
10421127
case TC_MP_JB:
10431128
name = "JB";
10441129
break;

src/tape_drivers/quantum_tape.c

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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, 205440 },
251+
{ FORMAT_MEDIUM, 3180 },
252+
{ LOAD_UNLOAD, 780 },
253+
{ LOCATE10, 104880 },
254+
{ LOCATE16, 104880 },
255+
{ READ, 2340 },
256+
{ READ_BUFFER, 480 },
257+
{ REWIND, 600 },
258+
{ SEND_DIAGNOSTIC, 1980 },
259+
{ SET_CAPACITY, 780 },
260+
{ SPACE6, 2940 },
261+
{ SPACE16, 2940 },
262+
{ VERIFY, 104880 },
263+
{ WRITE, 1500 },
264+
{ WRITE_BUFFER, 540 },
265+
{ WRITE_FILEMARKS6, 1620 },
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: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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 */

src/tape_drivers/vendor_compat.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,12 @@ unsigned char assume_cart_type(const unsigned char dc)
353353
case TC_DC_LTO9:
354354
cart = TC_MP_LTO9D_CART;
355355
break;
356+
case TC_DC_LTOA:
357+
cart = TC_MP_LTOAD_CART;
358+
break;
359+
case TC_DC_LTOPA:
360+
cart = TC_MP_LTOPAD_CART;
361+
break;
356362
default:
357363
// Do nothing
358364
break;

0 commit comments

Comments
 (0)