This chapter contains descriptions of the Transport (XPT) layer routines that SCSI/CAM device driver writers use. Table 7-1 contains a list of the routines with a short description of each. Following the table is a description of each routine. Appendix C lists the routines alphabetically and includes descriptions and syntax information in Digital UNIX reference-page format.
Routine | Summary Description |
xpt_action | Calls the appropriate XPT/SIM routine. |
xpt_ccb_alloc | Allocates a CAM control block (CCB). |
xpt_ccb_free | Frees a previously allocated CCB. |
xpt_init | Validates the initialized state of the CAM subsystem. |
The xpt_action routine calls the appropriate XPT/SIM routine. The routine routes the specified CCB to the appropriate SCSI Interface Module (SIM) or to the Configuration driver, depending on the CCB type and the path ID specified in the CCB. Vendor-unique CCBs are also supported. Those CCBs are passed to the appropriate SIM module according to the path ID specified in the CCB.
The xpt_ccb_alloc routine allocates a CAM control block (CCB) for use by a SCSI/CAM peripheral device driver. The xpt_ccb_alloc routine returns a pointer to a preallocated data buffer large enough to contain any CCB structure. The peripheral device driver uses this structure for its XPT/SIM requests. The routine also ensures that the SIM private data space and peripheral device driver pointer, cam_pdrv_ptr, are set up.
The xpt_ccb_free routine frees a previously allocated CCB. The routine returns a CCB, previously allocated by a peripheral device driver, to the CCB pool.
The xpt_init routine validates the initialized state of the CAM subsystem. The routine initializes all global and internal variables that the CAM subsystem uses through a call to the Configuration driver. Peripheral device drivers must call this routine either during or prior to their own initialization. The xpt_init routine simply returns to the calling SCSI/CAM peripheral device driver if the CAM subsystem was previously initialized.