Writing Device Drivers


The tran_tgt_init(9E) entry point allows the HBA to allocate and/or initialize any per-target resources. It also allows the HBA to qualify the device's address as valid and supportable for that particular HBA. By returning DDI_FAILURE, the instance of the target driver for that device will not be probed or attached.

This entry point is not required, and if none is supplied, the framework will attempt to probe and attach all possible instances of the appropriate target drivers.

 static int
 	dev_info_t					*hba_dip,
 	dev_info_t					*tgt_dip,
 	scsi_hba_tran_t					*tran,
 	struct scsi_device					*sd)
 	return ((sd->sd_address.a_target < N_ISP_TARGETS_WIDE &&
 			sd->sd_address.a_lun < 8) ? DDI_SUCCESS : DDI_FAILURE);