freebsd-dev/share/man
Kenneth D. Merry 64409eeee7 Add basic programmable early warning error injection to the sa(4) driver.
This will help application developers simulate end of tape conditions.

To inject an error in sa0:

sysctl kern.cam.sa.0.inject_eom=1

This will return the next read or write request queued with 0 bytes
written.  Any subsequent writes or reads will go along as usual.

This will also cause the early warning position flag to get set
for the next position query.  So, 'mt status' will show the BPEW
(Beyond Programmable Early Warning) flag on the first query after
an error injection.  After that, the position flags will be as they
are in the underlying tape drive.

Also, update the sa(4) man page to describe tape parameters,
which can be set via 'mt param'.

sys/cam/scsi/scsi_sa.c:
	In saregister(), create the inject_eom sysctl variable.

	In sastart(), check to see whether inject_eom is set.  If
	so, return the read or write with 0 bytes written to
	indicate EOM.  Set the set_pews_status flag so that we
	fake PEWS status in the next position call for reads, and the
	next 3 calls for writes.  This allows the user to see the BPEW
	flag one time via 'mt status'.

	In sagetpos(), check the set_pews_status flag and fake
	PEWS status and decrement the counter if it is set.

share/man/man4/sa.4:
	Document the inject_eom sysctl variable.

	Document all of the parameters currently supported via
	'mt param'.

usr.bin/mt/mt.1:
	Point the user to the sa(4) man page for more details on
	supported parameters.

MFC after:	3 days
Sponsored by:	Spectra Logic
2017-05-05 20:00:53 +00:00
..
man1 share: normalize paths using SRCTOP-relative paths or :H when possible 2017-03-04 11:26:40 +00:00
man3 pthread_mutex_consistent: sort SEE ALSO by reference name 2017-03-27 19:17:30 +00:00
man4 Add basic programmable early warning error injection to the sa(4) driver. 2017-05-05 20:00:53 +00:00
man5 Remove NATM configuration bits and assorted NATM and ATM remnants. 2017-04-25 21:59:34 +00:00
man6 Separate manual pages into their own package. 2016-01-21 16:36:33 +00:00
man7 Grammar fixes. 2017-05-05 18:36:41 +00:00
man8 More ATM and NATM removal 2017-04-27 16:05:12 +00:00
man9 More ATM and NATM removal 2017-04-27 16:05:12 +00:00
Makefile Add more SUBDIR_PARALLEL. 2015-10-15 22:55:08 +00:00