Solaris 7 Software Developer Supplement

New Default SCSI HBA Driver Entry Points

To support the minimal set of hot-plugging operations, drivers might need to implement support for bus quiesce, bus unquiesce, and reset. The scsi_hba_tran(9S) structure has been extended to support these new operations. If quiesce/unquiesce/reset is not required by hardware, no driver changes are needed.

The following new fields have been added to the scsi_hba_tran structure:

		int (*tran_quiesce)(dev_info_t *hba_dip);
		int (*tran_unquiesce)(dev_info_t *hba_dip);
		int (*tran_bus_reset)(dev_info_t *hba_dip, int level);

The new driver entry points are introduced in the following sections.

tran_quiesce() and tran_unquiesce()

Quiesce and unquiesce a SCSI bus.

		#include <sys/scsi/scsi.h>

		int prefixtran_quiesce(dev_info_t *hba_dip);

		int prefixtran_unquiesce(dev_info_t *hba_dip);

tran_quiesce(9E) and tran_unquiesce(9E) are required to be implemented by an HBA driver to support dynamic reconfiguration (DR) of SCSI devices on buses that were not designed to support hot-plugging.

The tran_quiesce() and tran_unquiesce() vectors in the scsi_hba_tran(9S) structure should be initialized during the HBA driver's attach(9E) to point to HBA entry points so they are called when a user initiates quiesce and unquiesce operations.

tran_quiesce(9E) is called by the SCSA framework to stop all activity on a SCSI bus prior to and during the reconfiguration of devices attached to the SCSI bus. tran_unquiesce(9E) is called by the SCSA framework to resume activity on the SCSI bus after the reconfiguration operation has been completed.

HBA drivers are required to handle tran_quiesce(9E) by waiting for all outstanding commands to complete before returning success. After the HBA has quiesced the bus, it must queue any new I/O requests from target drivers until the SCSA framework calls the corresponding tran_unquiesce(9E) entry point.

HBA drivers handle calls to tran_unquiesce(9E) by starting any target driver I/O requests that were queued by the HBA during the time the bus was quiesced.

tran_bus_reset()

tran_bus_reset(9E) must reset the SCSI bus without resetting targets.

		#include <sys/scsi/scsi.h>

		int prefixtran_bus_reset(dev_info_t *hba_dip, int level);

Where level is:

RESET_BUS

reset the SCSI bus only, not the targets

The tran_bus_reset() vector in the scsi_hba_tran(9S) structure should be initialized during the HBA driver's attach(9E) to point to an HBA entry point to be called when a user initiates a bus reset.

Implementation is hardware specific. If it is not possible to reset the SCSI bus without affecting the targets, the HBA driver should fail RESET_BUS or not initialize this vector.

For more information, see "Converting Device Drivers to Support Hot-plugging" in the book Writing Device Drivers.