DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

xlat(D2sdi)


xlat -- perform address translations required for I/O operation

Synopsis

   int prefixxlat(struct hbadata *hbap, int b_flags, struct proc *procp, int flag);

Description

The xlat( ) entry point routine performs any address translation required for the I/O operation such as translating the scb(D4sdi) SCSI command block virtual addresses to physical addresses in DDI versions prior to version 8.

Arguments


hbap
a pointer to the SCSI command block requiring translation

b_flags
the b_flags member of the buf(D4) buffer header structure

procp
a pointer to the process structure

flag
indicates whether the translation may sleep or not and is set to KM_SLEEP or KM_NOSLEEP.

Return values

On success, xlat returns SDI_RET_OK. On failure, it returns SDI_RET_ERR.

Usage

The xlat( ) entry point routine is required for all HBA drivers. SDI calls this routine for each I/O operation to perform the translation that is required to complete the I/O operation. For most DDI 8 drivers, the driver does not need to perform any translation and simply returns.

If the KM_SLEEP flag is set, the HBA driver should block if resources are not available; it should not return without the translation. Target drivers do not check for an error in this case, so returning without the translation can cause system corruption.

Context and synchronization

If flag is KM_SLEEP, blockable context. If flag is KM_NOSLEEP, non-blockable context.

Applicable hardware

All

Version applicability

sdi: 1, 2, 3, 4 HBA drivers.

Differences between versions

In DDI versions prior to version 8, The xlat( ) entry point converts the virtual address of the data buffer into the physical address. The proc pointer is passed to the vtop(D3) function to do this translation. Note that the vtop( ) routine is not available to DDI 8 drivers.

If the data buffer is not physically contiguous or if it is too large to be handled by a single operation, a driver written for DDI versions prior to version 8 must break the buffer into scatter/gather lists. A DDI 8 driver does not need to do this breakup, but instead specifies its requirement in the bcb(D4) structure by setting BA_SCGTH in the bcb_addrtype member of the bcb(D4) structure. When BA_SCGTH is set, a driver always gets a buffer that is already broken into scatter/gather lists.

See Also

bcb(D4), vtop(D3)

``Scatter/gather operations'' in HDK Technical Reference


19 June 2005
© 2005 The SCO Group, Inc. All rights reserved.
OpenServer 6 and UnixWare (SVR5) HDK - June 2005