From owner-freebsd-scsi@FreeBSD.ORG Wed May 20 23:26:31 2015 Return-Path: Delivered-To: scsi@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C68ECC34; Wed, 20 May 2015 23:26:31 +0000 (UTC) Received: from mithlond.kdm.org (mithlond.kdm.org [70.56.43.85]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "A1-33714", Issuer "A1-33714" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 986941699; Wed, 20 May 2015 23:26:31 +0000 (UTC) Received: from mithlond.kdm.org (localhost [127.0.0.1]) by mithlond.kdm.org (8.14.9/8.14.9) with ESMTP id t4KNQNeV087204 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 20 May 2015 17:26:23 -0600 (MDT) (envelope-from ken@mithlond.kdm.org) Received: (from ken@localhost) by mithlond.kdm.org (8.14.9/8.14.9/Submit) id t4KNQNIP087203; Wed, 20 May 2015 17:26:23 -0600 (MDT) (envelope-from ken) Date: Wed, 20 May 2015 17:26:23 -0600 From: "Kenneth D. Merry" To: current@freebsd.org, scsi@freebsd.org Subject: camcontrol(8) attrib patches available Message-ID: <20150520232623.GA87007@mithlond.kdm.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (mithlond.kdm.org [127.0.0.1]); Wed, 20 May 2015 17:26:23 -0600 (MDT) X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS autolearn=ham autolearn_force=no version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mithlond.kdm.org X-BeenThere: freebsd-scsi@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SCSI subsystem List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 May 2015 23:26:32 -0000 I have put patches to camcontrol(8) to implement the attrib subcommand here: FreeBSD/head as of SVN revision 283160: http://people.freebsd.org/~ken/camcontrol_attrib.20150520.1.txt FreeBSD stable/10 as of SVN revision 283161: http://people.freebsd.org/~ken/camcontrol_attrib.stable10.20150520.1.txt The patches also add libcam support for handling SCSI READ ATTRIBUTE data, and adds a new sbuf_hexdump(3)/(9) routine. The SCSI READ ATTRIBUTE command is used to read Medium Auxiliary Memory on SCSI devices. This is usually found in the small (4KB-16KB) flash chips on LTO and other similar tapes. I have not yet implemented attribute writing support. Here is an abbreviated example of the output: ====== [root@black-pearl ~]# camcontrol attrib sa0 -r attr_val Remaining Capacity in Partition (0x0000)[8](RO): 35048 MB Maximum Capacity in Partition (0x0001)[8](RO): 35060 MB TapeAlert Flags (0x0002)[8](RO): 0x0 Load Count (0x0003)[8](RO): 29 MAM Space Remaining (0x0004)[8](RO): 2321 bytes Assigning Organization (0x0005)[8](RO): LTO-CVE Format Density Code (0x0006)[1](RO): 0x5a Initialization Count (0x0007)[2](RO): 20 Volume Change Reference (0x0009)[4](RO): 0x47 Device Vendor/Serial at Last Load (0x020a)[40](RO): IBM 1068022701 Device Vendor/Serial at Last Load - 1 (0x020b)[40](RO): IBM 1068022701 Device Vendor/Serial at Last Load - 2 (0x020c)[40](RO): IBM 1068022701 Device Vendor/Serial at Last Load - 3 (0x020d)[40](RO): IBM 1068022701 Total MB Written in Medium Life (0x0220)[8](RO): 40009 MB Total MB Read in Medium Life (0x0221)[8](RO): 3149 MB Total MB Written in Current/Last Load (0x0222)[8](RO): 0 MB Total MB Read in Current/Last Load (0x0223)[8](RO): 12 MB Logical Position of First Encrypted Block (0x0224)[8](RO): 18446744073709551615 Logical Position of First Unencrypted Block after First Encrypted Block (0x0225)[8](RO): 18446744073709551615 Medium Manufacturer (0x0400)[8](RO): HP Medium Serial Number (0x0401)[32](RO): AE46TCFD0U Medium Length (0x0402)[4](RO): 846 m Medium Width (0x0403)[4](RO): 12.7 mm Assigning Organization (0x0404)[8](RO): LTO-CVE Medium Density Code (0x0405)[1](RO): 0x5a Medium Manufacture Date (0x0406)[8](RO): 20130506 MAM Capacity (0x0407)[8](RO): 16384 bytes Medium Type (0x0408)[1](RO): 0x0 Medium Type Information (0x0409)[2](RO): 0x0 Application Vendor (0x0800)[8](RW): IBM Application Name (0x0801)[32](RW): LTFS Application Version (0x0802)[8](RW): 1.3.0.2 User Medium Text Label (0x0803)[160](RW): Text Localization Identifier (0x0805)[1](RW): 0x81 Barcode (0x0806)[32](RW): Application Format Version (0x080b)[16](RW): 2.2.0 Volume Coherency Information (0x080c)[70](RW): Volume Change Reference Value: 0x45 Volume Coherency Count: 1 Volume Coherency Set Identifier: 0x5 Application Client Specific Information: LTFS LTFS UUID: 28076791-d64e-4cd7-bc43-fa51ec097d83 LTFS Version: 1 ====== Testing and comments (on the camcontrol changes or the library changes) are welcome. Thanks, Ken -- Kenneth Merry ken@FreeBSD.ORG