Commit Graph

55 Commits

Author SHA1 Message Date
Kenneth D. Merry
21b6ee96fc 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
explaining UTF-8 printing 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
MFC After:	1 week
2013-04-19 20:03:51 +00:00
Ed Schouten
469743871e Add static keywords to chio(1).
All other global variables are already marked static, so for consistency
sake, add them to these three arrays as well.
2011-12-11 20:53:12 +00:00
Ulrich Spörlein
c5d27505b6 Zero struct before reading from it
PR:	   140384
Found by:  clang static analyzer
MFC after: 3 weeks
2010-06-02 09:34:41 +00:00
Joerg Wunsch
7f33c7dd6f When running a "chio return" operation using a physical source unit
rather than a voltag name, do not set the CESR_VOLTAGS flags in the
CHIOGSTATUS command requesting the current status.  As voltags are an
optional feature that must be handled as "reserved" by media changers
not implementing the feature, always setting CESR_VOLTAGS resulted in
the command being aborted with an `Invalid field in CDB', and
consequently the "chio return" failed, for media changers that do not
support voltags.

MFC after:	1 week
2008-10-30 19:51:02 +00:00
Xin LI
6984496e54 Don't specify SRCS= when it can be obtained from PROGS= 2005-01-27 13:25:09 +00:00
Ruslan Ermilov
6fca4c7c3f Add the new standard EXIT STATUS section where appropriate.
Sort standard sections in the (documented) preferred order.
2005-01-16 16:41:59 +00:00
Ruslan Ermilov
5f05dfac32 Removed harmful empty lines that crept in during the copyright
header update.
2005-01-13 08:46:19 +00:00
Warner Losh
9ddb49cbe4 /*- or .\"- or #- to begin license clauses. 2005-01-10 08:39:26 +00:00
Ruslan Ermilov
eccea571a7 Mechanically kill hard sentence breaks. 2004-07-02 21:04:19 +00:00
David E. O'Brien
09a80d4867 Quiet warnings about copyright[]. 2003-05-01 16:58:57 +00:00
Philippe Charnier
45ebb0c103 The .Nm utility 2003-03-24 16:09:07 +00:00
Jens Schweikhardt
9d5abbddbf Correct typos, mostly s/ a / an / where appropriate. Some whitespace cleanup,
especially in troff files.
2003-01-01 18:49:04 +00:00
David Malone
0567678261 Remove double #include <sys/cdef.h> and __FBSDID.
PR:		40053
Submitted by:	Dan Lukes <dan@obluda.cz>
2002-07-01 10:46:39 +00:00
David E. O'Brien
5eb43ac2f7 Consistently use __FBSDID 2002-06-30 05:13:54 +00:00
Mark Murray
55fad6bb0f Replace use of __progname with the functionally identical and more
acceptable getprogname(3).
2002-03-24 14:56:55 +00:00
Warner Losh
250a0cef8f Use ANSI-99 int names (uintXX_t) over traditional BSD int names
(u_intXX_t).
2002-03-05 05:28:49 +00:00
Mark Murray
ece5764570 Fix a boatload of warnings inspired by lint, a commercial lint
and WARNS=4.
2002-02-22 21:21:37 +00:00
Warner Losh
5dce647c1b Modernization effort for bin/c*:
o __P has been reoved
  o Old-style K&R declarations have been converted to new C89 style
  o register has been removed
  o prototype for main() has been removed (gcc3 makes it an error)
  o int main(int argc, char *argv[]) is the preferred main definition.
  o Attempt to not break style(9) conformance for declarations more than
    they already are.

  Approved by: arch@, new style(9)
2002-02-02 06:15:22 +00:00
David E. O'Brien
a748290789 Default to WARNS=2. Binary builds that cannot handle this must explicitly
set WARNS=0.

Reviewed by:	mike
2001-12-04 01:57:47 +00:00
Ruslan Ermilov
94ba280c59 mdoc(7) police: join split punctuation to macro calls. 2001-08-10 17:35:21 +00:00
Dima Dorfman
7ebcc426ef Remove whitespace at EOL. 2001-07-15 07:53:42 +00:00
Dima Dorfman
70d51341bf mdoc(7) police: remove extraneous .Pp before and/or after .Sh. 2001-07-09 09:54:33 +00:00
Mike Heffner
616203938d Fix warnings on alpha and re-enable WARNS=2.
Submitted by:	Mike Barcroft <mike@q9media.com>
2001-07-04 21:35:15 +00:00
Mike Heffner
28059d16ea Argh...this isn't ready for WARNS=2 on alpha. 2001-07-03 03:34:42 +00:00
Mike Heffner
6c120f4628 Constify and lockdown with WARNS=2.
Submitted by:	Mike Barcroft <mike@q9media.com>
MFC after:	2 weeks
2001-07-03 03:22:49 +00:00
Ruslan Ermilov
3ab9a9d0e0 Removed -I${.CURDIR}/.../sys from CFLAGS. 2001-05-18 13:41:42 +00:00
Ruslan Ermilov
e30b1c64e7 mdoc(7) police: simplify construct. 2000-12-21 15:31:28 +00:00
Ruslan Ermilov
725ab6287f log 2000-11-22 09:23:54 +00:00
Ben Smithurst
32e5e4cfc3 more removal of trailing periods from SEE ALSO. 2000-11-15 16:44:24 +00:00
Ruslan Ermilov
726b61ab5f Avoid use of direct troff requests in mdoc(7) manual pages. 2000-11-10 17:46:15 +00:00
Ruslan Ermilov
52e0c32b37 Use .Cm macro where appropriate. 2000-09-19 16:15:54 +00:00
Sheldon Hearn
9b24396beb Fix horrendous abuse of the Nm and Pa mdoc macros, and remove troff
bold markers \fB and \fR.
2000-09-19 09:46:01 +00:00
Kenneth D. Merry
f944dc77e7 Add two new features to chio(1):
- The ability to specify elements by volume tag instead of their actual
   physical location.  e.g., instead of:
	chio move slot 3 slot 4
   you would now use:
	chio move voltag FOO slot 4

 - The ability to return an element to its previous location, as specified
   by the source element.  e.g., instead of:
	chio move drive 0 slot 4
   you would now use:
	chio return drive 0
   or
	chio return voltag FOO

These features will obviously only work with changers that support volume
tags and/or source element IDs.  chio(1) should fail gracefully if the user
attempts to use these new features and the source element ID or volume tag
are not found.

PR:		bin/21178
Submitted by:	"C. Stephen Gunn" <csg@waterspout.com>
Reviewed by:	ken
2000-09-18 06:09:11 +00:00
Warner Losh
2c15efcfb5 Don't explicitly declare optarg and optind. These are declared in
unistd.h, which is already included.
2000-08-16 05:14:49 +00:00
Peter Wemm
2a4562393f $Id$ -> $FreeBSD$ 1999-08-27 23:15:48 +00:00
Kris Kennaway
98ae496f7f Correct some style issues in my previous commit.
Submitted by:	bde
1999-07-22 14:26:21 +00:00
Kris Kennaway
794bf053c4 Undo some of the reversions from previous revisions, and attempt to
minimize diffs with {Net,Open}BSD

Hinted-More-Or-Less-By:	bde
1999-06-21 13:23:23 +00:00
Kris Kennaway
305a253acf Changes from OpenBSD:
* Better usage() - correct syntax, display available commands
	  instead of examples
	* Accept command abbreviations
	* sprintf -> snprintf (for paranoia)
	* manpage capitalisation tweak

Obtained from:	OpenBSD
1999-06-07 13:53:57 +00:00
Warner Losh
b790f1b6de getopt(3) returns -1 not EOF. 1999-05-23 23:24:26 +00:00
Warner Losh
426e9c1dcc First set of fixes to keep egcs happy. These include {} around single
statement if blocks[*] when the else could be ambiguous, not defaulting
to int type and removal of some unused variables.

[*] This is explicitly allowed by style(9) when the single statement
spans more than one line.

Reviewed by: obrien, chuckr
1999-04-25 21:13:34 +00:00
Bruce Evans
9776f3dbad Fixed printf format errors (new bugs in rev.1.7). Fixed a spelling error
(rev.1.7 blew away most of rev.1.2-1.6; I'm only fixing blowing away of
rev.1.4).
1998-12-07 10:16:58 +00:00
Bill Fumerola
969385c1d5 superceded -> superseded, which after some debate on #FreeBSD is in
fact the proper spelling.

PR:		docs/8697
Submitted by:	Sascha Blank <blank@fox.uni-trier.de>
1998-11-30 23:05:38 +00:00
Kenneth D. Merry
c8c7ba2b9a Fix 'chio params' so that it actually prints out the current picker.
(This was broken when the volume tag changes went in.)

Submitted by:	Josef Karthauser <joe@pavilion.net>
1998-10-01 23:30:14 +00:00
Justin T. Gibbs
20bf9a142c Updated the ch(4) driver and chio(1) command to include volume
tag support.  These changes have been tested with a Breeze Hill
Q47 DLT and a DEC DLT2500 media changer.  The latter has no
volume tag support.

The chio(1) command was updated to include various flags to the
status subcommand.  These flags can be used to select additional
information to be displayed (like volume tags).

A new chio(1) subcommand named 'voltag' has been added which allows
for changes to volume tags inside the media changer controller.
This could not be tested as the Q47 does not provide the functio-
nality.

Submitted by:	Hans Huebner
1998-09-15 07:48:51 +00:00
Steve Price
32c2131395 Fix a bunch of spelling errors.
PR:		6856
Submitted by:	Josh Gilliam <josh@quick.net>
1998-06-04 21:06:07 +00:00
Philippe Charnier
930ab418d3 Do not remove include of <sys/param.h> and <sys/types.h>. They should
be here before including almost any POSIX header.
Requested by:	Bruce
1998-05-13 07:19:45 +00:00
Philippe Charnier
cbf6f7d358 Correct use of .Nm and other cosmetics. Add rcsid. Remove unused #inc. 1998-05-06 06:51:42 +00:00
Philippe Charnier
05e61fd508 .Sh AUTHOR -> .Sh AUTHORS
Use .An/.Aq
1998-03-19 07:26:37 +00:00
Eivind Eklund
112e2ea9f2 spelling
Obtained from:  OpenBSD (src/bin/chio/chio.c rev 1.7) by todd@openbsd.org
1998-02-11 06:34:38 +00:00
Wolfram Schneider
f6b31571f6 spelling corrections.
PR: docs/4450
Submitted by: josh@quick.net
1997-09-13 16:01:53 +00:00