]> CyberLeo.Net >> Repos - FreeBSD/stable/9.git/commit
MFC: 249658, 249701
authorken <ken@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Tue, 25 Jun 2013 21:43:49 +0000 (21:43 +0000)
committerken <ken@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Tue, 25 Jun 2013 21:43:49 +0000 (21:43 +0000)
commit92d2b7b256398f698fedbbdf205a9e3657cf8a98
tree6120612f069d1e00e82725e4d65645cb0e90a5e8
parentf57835ab97cb06b8f75928ac7cfb36330178f1af
MFC: 249658, 249701

Update chio(1) and ch(4) to support reporting element designators.

This allows mapping a tape drive in a changer (as reported by
'chio status') to a sa(4) driver instance by comparing the
serial numbers.

The designators can be ASCII (which is printed out directly), binary
(which is printed in hex format) or UTF-8, which is printed in either
native UTF-8 format if the terminal can support it, or in %XX notation
for non-ASCII characters.  Thanks to Hiroki Sato <hrs@> for the
explanation and example UTF-8 printing code.

chio.h: Modify the changer_element_status structure to add new
fields and definitions from the SMC3r16 spec.

Rename the original CHIOGSTATUS ioctl to OCHIOGTATUS and
define a new CHIOGSTATUS ioctl.

Clean up some tab/space issues.

chio.c:  For the 'status' subcommand, print the designator field
if it is supplied by a device.

scsi_ch.h: Add new flags for DVCID and CURDATA to the READ
ELEMENT STATUS command structure.

Add a read_element_status_device_id structure
for the data fields in the new standard. Add new
unions, dt_or_obsolete and voltage_devid, to hold
and address data from either SCSI-2 or newer devices.

scsi_ch.c: Implement support for fetching device IDs with READ
ELEMENT STATUS data.

Add new arguments to scsi_read_element_status() to
allow the user to request the DVCID and CURDATA bits.
This isn't compiled into libcam (it's only an internal
kernel interface), so we don't need any special
handling for the API change.

If the user issues the new CHIOGSTATUS ioctl, copy all of
the available element status data out.  If he issues the
OCHIOGSTATUS ioctl, we don't copy the new fields in the
structure.

Fix a bug in chopen() that would result in the peripheral
never getting unheld if chgetparams() failed.

Sponsored by: Spectra Logic
Submitted by: Po-Li Soong

git-svn-id: svn://svn.freebsd.org/base/stable/9@252214 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
bin/chio/chio.c
sys/cam/scsi/scsi_ch.c
sys/cam/scsi/scsi_ch.h
sys/sys/chio.h