The tran_getcap() and tran_setcap() vectors in the scsi_hba_tran(9S) structure must be initialized during the HBA driver's attach(9E) to point to HBA entry points to be called when a target driver calls scsi_ifgetcap(9F) and scsi_ifsetcap(9F).
tran_getcap() is called to get the current value of a capability specific to features provided by the HBA hardware or driver. The name of the capability cap is the NULL terminated capability string.
If whom is non-zero, the request is for the current value of the capability defined for the target specified by the scsi_address(9S) structure pointed to by ap; if whom is 0,
all targets are affected; else, the target specified by the scsi_address structure pointed to by ap is affected.
tran_setcap() is called to set the value of the capability cap to the value of value. If whom is
non-zero, the capability should be set for the target specified by the scsi_address(9S) structure pointed to by ap; if whom is 0, all targets are affected; else, the target specified by the scsi_address structure pointed to by ap is affected. It is recommended that HBA drivers do not support setting capabilities for all
targets, that is, whom is 0.
A device may support only a subset of the defined capabilities.
Refer to scsi_ifgetcap(9F) for the list of defined
capabilities.
HBA drivers should use scsi_hba_lookup_capstr(9F) to match cap against the canonical capability strings.
|