freebsd-skq/sys/cam/scsi
Alexander Motin 3631c6382f Implement media change notification for DA and CD removable media devices.
It includes three parts:
 1) Modifications to CAM to detect media media changes and report them to
disk(9) layer. For modern SATA (and potentially UAS) devices it utilizes
Asynchronous Notification mechanism to receive events from hardware.
Active polling with TEST UNIT READY commands with 3 seconds period is used
for incapable hardware. After that both CD and DA drivers work the same way,
detecting two conditions: "NOT READY: Medium not present" after medium was
detected previously, and "UNIT ATTENTION: Not ready to ready change, medium
may have changed". First one reported to disk(9) as media removal, second
as media insert/change. To reliably receive second event new
AC_UNIT_ATTENTION async added to make UAs broadcasted to all periphs by
generic error handling code in cam_periph_error().
 2) Modifications to GEOM core to handle media remove and change events.
Media removal handled by spoiling all consumers attached to the provider.
Media change event also schedules provider retaste after spoiling to probe
new media. New flag G_CF_ORPHAN was added to consumers to reflect that
consumer is in process of destruction. It allows retaste to create new
geom instance of the same class, while previous one is still dying.
 3) Modifications to some GEOM classes: DEV -- to report media change
events to devd; VFS -- to handle spoiling same as orphan to prevent
accessing replaced media. PART class already handles spoiling alike to
orphan.

Reviewed by:	silence on geom@ and scsi@
Tested by:	avg
Sponsored by:	iXsystems, Inc. / PC-BSD
MFC after:	2 months
2012-07-29 11:51:48 +00:00
..
scsi_all.c Fix some typos in r238595. 2012-07-18 12:41:09 +00:00
scsi_all.h Add scsi_extract_sense_ccb() -- wrapper around scsi_extract_sense_len(). 2012-06-23 12:32:53 +00:00
scsi_cd.c Implement media change notification for DA and CD removable media devices. 2012-07-29 11:51:48 +00:00
scsi_cd.h
scsi_ch.c Remove variables which are initialized but never used thereafter 2012-07-07 17:17:43 +00:00
scsi_ch.h - fix duplicate "a a" in some comments 2011-11-13 17:06:33 +00:00
scsi_da.c Implement media change notification for DA and CD removable media devices. 2012-07-29 11:51:48 +00:00
scsi_da.h Change 'camcontrol defects' to first probe a drive to find out how much 2012-06-22 18:57:06 +00:00
scsi_dvcfg.h
scsi_enc_internal.h MFprojects/zfsd: 2012-05-24 14:07:44 +00:00
scsi_enc_safte.c MFprojects/zfsd: 2012-05-24 14:07:44 +00:00
scsi_enc_ses.c Do not call ses_softc_cleanup() in case of configuration read failure. 2012-07-24 13:08:43 +00:00
scsi_enc.c Fix several reference counting and object lifetime issues between 2012-06-20 17:08:00 +00:00
scsi_enc.h MFprojects/zfsd: 2012-05-24 14:07:44 +00:00
scsi_iu.h
scsi_low_pisa.c
scsi_low_pisa.h
scsi_low.c Mark MALLOC_DEFINEs static that have no corresponding MALLOC_DECLAREs. 2011-11-07 06:44:47 +00:00
scsi_low.h
scsi_message.h
scsi_pass.c Fix several reference counting and object lifetime issues between 2012-06-20 17:08:00 +00:00
scsi_pass.h
scsi_pt.c Tune and add some missing CAM_DEBUG() points for better consistency. 2012-06-05 09:45:42 +00:00
scsi_pt.h
scsi_sa.c To make CAM debugging easier, compile in some debug flags (CAM_DEBUG_INFO, 2012-06-07 10:05:51 +00:00
scsi_sa.h
scsi_ses.h Fix off by one error in ses_enc_desc_last_byte(). 2012-07-24 13:32:49 +00:00
scsi_sg.c Work around a race condition in devfs by changing the way closes 2012-05-27 06:11:09 +00:00
scsi_sg.h
scsi_targ_bh.c Add the CAM Target Layer (CTL). 2012-01-12 00:34:33 +00:00
scsi_target.c To make CAM debugging easier, compile in some debug flags (CAM_DEBUG_INFO, 2012-06-07 10:05:51 +00:00
scsi_targetio.h
scsi_xpt.c One more major cam_periph_error() rewrite to improve error handling and 2012-06-09 13:07:44 +00:00
smp_all.c Add Serial Management Protocol (SMP) passthrough support to CAM. 2010-11-30 22:39:46 +00:00
smp_all.h Add Serial Management Protocol (SMP) passthrough support to CAM. 2010-11-30 22:39:46 +00:00