summaryrefslogtreecommitdiffstats
path: root/usr.bin
diff options
context:
space:
mode:
authorken <ken@FreeBSD.org>2015-03-18 20:52:34 +0000
committerken <ken@FreeBSD.org>2015-03-18 20:52:34 +0000
commit1cc0a333e959a384a88704ae1e68dfc880df51e7 (patch)
tree1f33d20d8149fd8caa8e8d7b073a73593db170a8 /usr.bin
parent86edfc3fbee5ced122795b493451463fa2c1dddf (diff)
downloadFreeBSD-src-1cc0a333e959a384a88704ae1e68dfc880df51e7.zip
FreeBSD-src-1cc0a333e959a384a88704ae1e68dfc880df51e7.tar.gz
Fix a couple of problems in the sa(4) media type reports.
The only drives I have discovered so far that support medium type reports are newer HP LTO (LTO-5 and LTO-6) drives. IBM drives only support the density reports. sys/cam/scsi/scsi_sa.h: The number of possible density codes in the medium type report is 9, not 8. This caused problems parsing all of the medium type report after this point in the structure. usr.bin/mt/mt.c: Run the density codes returned in the medium type report through denstostring(), just like the primary and secondary density codes in the density report. This will print the density code in hex, and give a text description if it is available. Thanks to Rudolf Cejka for doing extensive testing with HP LTO drives and Bacula and discovering these problems. Tested by: Rudolf Cejka <cejkar at fit.vutbr.cz> Sponsored by: Spectra Logic MFC after: 4 days
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/mt/mt.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/mt/mt.c b/usr.bin/mt/mt.c
index 3166831..fa66148 100644
--- a/usr.bin/mt/mt.c
+++ b/usr.bin/mt/mt.c
@@ -1406,9 +1406,9 @@ mt_print_density_entry(struct mt_status_entry *density_root, int indent)
continue;
}
if ((strcmp(entry->entry_name, "primary_density_code") == 0)
- || (strcmp(entry->entry_name, "secondary_density_code") == 0)){
+ || (strcmp(entry->entry_name, "secondary_density_code") == 0)
+ || (strcmp(entry->entry_name, "density_code") == 0)) {
- /* XXX KDM this should really be unsigned */
printf("%*s%s (%s): %s\n", indent, "", entry->desc ?
entry->desc : "", entry->entry_name,
denstostring(entry->value_unsigned));
OpenPOWER on IntegriCloud