Deleted Added
full compact
mtlib.c (279219) mtlib.c (280438)
1/*-
2 * Copyright (c) 2013, 2014, 2015 Spectra Logic Corporation
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 17 unchanged lines hidden (view full) ---

26 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
27 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28 * POSSIBILITY OF SUCH DAMAGES.
29 *
30 * Authors: Ken Merry (Spectra Logic Corporation)
31 */
32
33#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2013, 2014, 2015 Spectra Logic Corporation
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 17 unchanged lines hidden (view full) ---

26 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
27 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28 * POSSIBILITY OF SUCH DAMAGES.
29 *
30 * Authors: Ken Merry (Spectra Logic Corporation)
31 */
32
33#include <sys/cdefs.h>
34__FBSDID("$FreeBSD: head/lib/libmt/mtlib.c 279219 2015-02-23 21:59:30Z ken $");
34__FBSDID("$FreeBSD: stable/10/lib/libmt/mtlib.c 280438 2015-03-24 14:36:10Z ken $");
35
36#include <sys/types.h>
37#include <sys/ioctl.h>
38#include <sys/mtio.h>
39#include <sys/queue.h>
40#include <sys/sbuf.h>
41
42#include <ctype.h>

--- 20 unchanged lines hidden (view full) ---

63 struct mt_status_entry *entry;
64
65 mtinfo = (struct mt_status_data *)user_data;
66
67 if (mtinfo->error != 0)
68 return;
69
70 mtinfo->level++;
35
36#include <sys/types.h>
37#include <sys/ioctl.h>
38#include <sys/mtio.h>
39#include <sys/queue.h>
40#include <sys/sbuf.h>
41
42#include <ctype.h>

--- 20 unchanged lines hidden (view full) ---

63 struct mt_status_entry *entry;
64
65 mtinfo = (struct mt_status_data *)user_data;
66
67 if (mtinfo->error != 0)
68 return;
69
70 mtinfo->level++;
71 if ((u_int)mtinfo->level > (sizeof(mtinfo->cur_sb) /
71 if ((u_int)mtinfo->level >= (sizeof(mtinfo->cur_sb) /
72 sizeof(mtinfo->cur_sb[0]))) {
73 mtinfo->error = 1;
74 snprintf(mtinfo->error_str, sizeof(mtinfo->error_str),
75 "%s: too many nesting levels, %zd max", __func__,
76 sizeof(mtinfo->cur_sb) / sizeof(mtinfo->cur_sb[0]));
77 return;
78 }
79

--- 483 unchanged lines hidden (view full) ---

563 *
564 * LTO 1-6 definitions obtained from the eighth edition of the
565 * IBM TotalStorage LTO Ultrium Tape Drive SCSI Reference
566 * (July 2007) and the second edition of the IBM System Storage LTO
567 * Tape Drive SCSI Reference (February 13, 2013).
568 *
569 * IBM 3592 definitions obtained from second edition of the IBM
570 * System Storage Tape Drive 3592 SCSI Reference (May 25, 2012).
72 sizeof(mtinfo->cur_sb[0]))) {
73 mtinfo->error = 1;
74 snprintf(mtinfo->error_str, sizeof(mtinfo->error_str),
75 "%s: too many nesting levels, %zd max", __func__,
76 sizeof(mtinfo->cur_sb) / sizeof(mtinfo->cur_sb[0]));
77 return;
78 }
79

--- 483 unchanged lines hidden (view full) ---

563 *
564 * LTO 1-6 definitions obtained from the eighth edition of the
565 * IBM TotalStorage LTO Ultrium Tape Drive SCSI Reference
566 * (July 2007) and the second edition of the IBM System Storage LTO
567 * Tape Drive SCSI Reference (February 13, 2013).
568 *
569 * IBM 3592 definitions obtained from second edition of the IBM
570 * System Storage Tape Drive 3592 SCSI Reference (May 25, 2012).
571 *
572 * DAT-72 and DAT-160 bpi values taken from "HP StorageWorks DAT160
573 * tape drive white paper", dated June 2007.
574 *
575 * DAT-160 / SDLT220 density code (0x48) conflict information
576 * found here:
577 *
578 * http://h20564.www2.hp.com/hpsc/doc/public/display?docId=emr_na-c01065117&sp4ts.oid=429311
579 * (Document ID c01065117)
571 */
572 /*Num. bpmm bpi Reference */
573 { 0x1, 32, 800, "X3.22-1983" },
574 { 0x2, 63, 1600, "X3.39-1986" },
575 { 0x3, 246, 6250, "X3.54-1986" },
576 { 0x5, 315, 8000, "X3.136-1986" },
577 { 0x6, 126, 3200, "X3.157-1987" },
578 { 0x7, 252, 6400, "X3.116-1986" },

--- 29 unchanged lines hidden (view full) ---

608 { 0x26, 3816, 97000, "DDS-4" },
609 { 0x27, 3056, 77611, "Mammoth" },
610 { 0x28, 1491, 37871, "X3.224" },
611 { 0x40, 4880, 123952, "LTO-1" },
612 { 0x41, 3868, 98250, "DLTapeIV(40GB)" },
613 { 0x42, 7398, 187909, "LTO-2" },
614 { 0x44, 9638, 244805, "LTO-3" },
615 { 0x46, 12725, 323215, "LTO-4" },
580 */
581 /*Num. bpmm bpi Reference */
582 { 0x1, 32, 800, "X3.22-1983" },
583 { 0x2, 63, 1600, "X3.39-1986" },
584 { 0x3, 246, 6250, "X3.54-1986" },
585 { 0x5, 315, 8000, "X3.136-1986" },
586 { 0x6, 126, 3200, "X3.157-1987" },
587 { 0x7, 252, 6400, "X3.116-1986" },

--- 29 unchanged lines hidden (view full) ---

617 { 0x26, 3816, 97000, "DDS-4" },
618 { 0x27, 3056, 77611, "Mammoth" },
619 { 0x28, 1491, 37871, "X3.224" },
620 { 0x40, 4880, 123952, "LTO-1" },
621 { 0x41, 3868, 98250, "DLTapeIV(40GB)" },
622 { 0x42, 7398, 187909, "LTO-2" },
623 { 0x44, 9638, 244805, "LTO-3" },
624 { 0x46, 12725, 323215, "LTO-4" },
625 { 0x47, 6417, 163000, "DAT-72" },
626 /*
627 * XXX KDM note that 0x48 is also the density code for DAT-160.
628 * For some reason they used overlapping density codes.
629 */
630#if 0
631 { 0x48, 6870, 174500, "DAT-160" },
632#endif
616 { 0x48, 5236, 133000, "SDLTapeI(110)" },
617 { 0x49, 7598, 193000, "SDLTapeI(160)" },
618 { 0x4a, 0, 0, "T10000A" },
619 { 0x4b, 0, 0, "T10000B" },
620 { 0x4c, 0, 0, "T10000C" },
621 { 0x4d, 0, 0, "T10000D" },
622 { 0x51, 11800, 299720, "3592A1 (unencrypted)" },
623 { 0x52, 11800, 299720, "3592A2 (unencrypted)" },

--- 133 unchanged lines hidden ---
633 { 0x48, 5236, 133000, "SDLTapeI(110)" },
634 { 0x49, 7598, 193000, "SDLTapeI(160)" },
635 { 0x4a, 0, 0, "T10000A" },
636 { 0x4b, 0, 0, "T10000B" },
637 { 0x4c, 0, 0, "T10000C" },
638 { 0x4d, 0, 0, "T10000D" },
639 { 0x51, 11800, 299720, "3592A1 (unencrypted)" },
640 { 0x52, 11800, 299720, "3592A2 (unencrypted)" },

--- 133 unchanged lines hidden ---