freebsd-dev/sys/cam/scsi
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
..
scsi_all.c Don't bother retrying errors for encrypted drives that are locked. 2017-05-03 14:53:27 +00:00
scsi_all.h Add the SCSI Solid State Media Log page (0x11) definition. 2017-05-04 17:23:39 +00:00
scsi_cd.c Add infrastructure to the ATA and SCSI transports that supports 2017-04-19 15:04:52 +00:00
scsi_cd.h Add CD/DVD Capabilities and Mechanical Status Page. 2015-09-29 09:09:37 +00:00
scsi_ch.c Release ccb if mode_buffer allocation fails. 2017-03-28 00:39:41 +00:00
scsi_ch.h sys/cam: spelling fixes in comments. 2016-04-29 21:05:48 +00:00
scsi_da.c Reorder the minimum_cmd_size code to make it a little smaller and 2017-04-20 20:46:34 +00:00
scsi_da.h Improve support for informational exceptions. 2016-12-19 10:25:47 +00:00
scsi_dvcfg.h
scsi_enc_internal.h Add infrastructure to the ATA and SCSI transports that supports 2017-04-19 15:04:52 +00:00
scsi_enc_safte.c Allow sleepable allocations in enclosure daemon threads. 2016-05-10 16:20:36 +00:00
scsi_enc_ses.c Make SES status updates more aggressive. 2016-11-29 13:48:36 +00:00
scsi_enc.c Add infrastructure to the ATA and SCSI transports that supports 2017-04-19 15:04:52 +00:00
scsi_enc.h Add API to obtain primary enclosure name and ID for /dev/sesX devices. 2015-11-21 10:22:01 +00:00
scsi_iu.h Start each of the license/copyright comments with /*- 2005-01-05 22:34:37 +00:00
scsi_low.c Remove dead mentions of CAM target mode APIs from drivers. 2017-02-19 17:27:58 +00:00
scsi_low.h sys/cam: spelling fixes in comments. 2016-04-29 21:05:48 +00:00
scsi_message.h Add partial support for QUERY TMF to CAM and isp(4). 2015-10-23 18:34:18 +00:00
scsi_pass.c Fix error recovery behavior in the pass(4) driver. 2017-05-03 20:59:47 +00:00
scsi_pass.h Add asynchronous command support to the pass(4) driver, and the new 2015-12-03 20:54:55 +00:00
scsi_pt.c Convert sys/cam to use make_dev_s(). 2016-01-07 20:22:55 +00:00
scsi_pt.h
scsi_sa.c Add basic programmable early warning error injection to the sa(4) driver. 2017-05-05 20:00:53 +00:00
scsi_sa.h Add the SCSI SSC Manufacturer assigned serial number VPD page. 2017-05-02 14:52:28 +00:00
scsi_ses.h Add support for EIIOE flag in Additional Element Status. 2016-11-07 18:21:53 +00:00
scsi_sg.c Convert sys/cam to use make_dev_s(). 2016-01-07 20:22:55 +00:00
scsi_sg.h Overhaul CAM SG driver IOCTL interfaces. 2014-06-02 19:53:53 +00:00
scsi_targ_bh.c Merge CAM locking changes from the projects/camlock branch to radically 2013-10-21 12:00:26 +00:00
scsi_target.c Make pass, sg and targ drivers respect HBA's maxio. 2015-09-30 13:31:37 +00:00
scsi_targetio.h
scsi_xpt.c Add infrastructure to the ATA and SCSI transports that supports 2017-04-19 15:04:52 +00:00
smp_all.c sys: use our nitems() macro when param.h is available. 2016-04-21 19:40:10 +00:00
smp_all.h