SCSIHA(7M)                                                          SCSIHA(7M)


NAME
     scsiha - SCSI bus and loop operation driver

SYNOPSIS
     /hw/scsi_ctlr/<number>/bus

DESCRIPTION
     The scsiha driver is used to pass requests to the scsi host adapter
     drivers to perform activities that aren't related to SCSI commands issued
     to individual devices.  On parallel SCSI, this includes operations like
     resetting a SCSI bus and probing for devices.  With Fibrechannel, it adds
     loop initialization, device reset and port bypass.

     All communication through the scsiha driver is via ioctls.  Opens and
     closes automatically succeed.  The ioctl structure is defined in
     <sys/scsi.h>, and is called scsi_ha_op . The scsi_ha_op structure:

       struct scsi_ha_op
       {
         uint    sb_opt;    /* command option */
         uint    sb_arg;    /* usually data count */
         uintptr_t sb_addr;   /* usually user address */
       };
       typedef struct scsi_ha_op scsi_ha_op_t;


     The sb_opt field is typically used to specify different options to the
     ioctl.  For example, the debug level of the host adapter driver, or a
     sub-operation code.
     The sb_arg field is typically used to specify how much data to transfer
     to/from the user level application and the driver.
     The sb_addr field should contain the user address to transfer the data
     to/from.

     There are a number of different ioctls that can be issued.

     SOP_RESET - fields unused
     SOP_SCAN - fields unused
     SOP_DEBUGLEVEL - uses sb_opt
     SOP_LIP - fields unused
     SOP_LIPRST - sb_opt is target ID to reset (255 = all targets)
     SOP_LPB - sb_opt is target ID to bypass
     SOP_LPE - sb_opt is target ID to enable
     SOP_LPEALL - fields unused
     SOP_QUIESCE - sb_opt is time for quiesce attempt, sb_arg is time for
     quiesce to be active
     SOP_QUIESCE_STATE - sb_addr is address of an unsigned 32 bit integer
     state variable
     SOP_UN_QUIESCE - fields unused
     SOP_GET_SCSI_PARMS - sb_addr is address to receive data


     SOP_DISABLE - fields unused
     SOP_ENABLE - fields unused
     SOP_CTLR_STATE - sb_addr is the address of an unsigned 32 bit integer
     which receives the controller state
     SOP_GETMAP_SZ - sb_addr is the address of an int which receives the count
     of targets
     SOP_GETMAP - sb_addr is a pointer to an array (see SOP_GETMAP_SZ) of
     fc_targ_map structures
     SOP_GET_LNK_STS - sb_opt is to get maximum loop ids value, controller,
     loop or fabric target ID (0xffff = all targets), sb_addr is the address
     to receive maximum loop ids value or link error statistics data
     SOP_GET_WWN - sb_addr points to uint64_t into which the controller's port
     name is stored
     SOP_GET_FW_VERSION - sb_addr points to a structure of fw_info_t into
     which the controller's product ID and firmware version are stored.
     SOP_FW_DOWNLOAD - sb_addr points to the beginning of a buffer which holds
     the firmware to be downloaded and sb_arg holds the length of the image.

     Hardware Interface Driver Support

     IOCTL               WD93    WD95    SCIP    QL      ADP78   FCADP   QLFC    LS
     -------------------------------------------------------------------------------
     SOP_RESET           YES     YES     YES     YES     YES     YES     YES     YES
     SOP_SCAN            YES     YES     YES     YES     YES     YES     YES     YES
     SOP_DEBUGLEVEL      NO      NO      NO      YES     NO      YES     YES     YES
     SOP_LIP             NO      NO      NO      NO      NO      YES     YES     YES
     SOP_LIPRST          NO      NO      NO      NO      NO      YES     YES     YES
     SOP_LPB             NO      NO      NO      NO      NO      YES     YES     YES
     SOP_LPE             NO      NO      NO      NO      NO      YES     YES     YES
     SOP_LPEALL          NO      NO      NO      NO      NO      YES     YES     YES
     SOP_QUIESCE         NO      NO      NO      YES     NO      YES     YES     YES
     SOP_QUIESCE_STATE   NO      NO      NO      YES     NO      YES     YES     YES
     SOP_UNQUIESCE       NO      NO      NO      YES     NO      YES     YES     YES
     SOP_GET_SCSI_PARMS  NO      NO      NO      YES     YES     NO      NO      YES
     SOP_DISABLE         NO      NO      NO      NO      NO      NO      YES     YES
     SOP_ENABLE          NO      NO      NO      NO      NO      NO      YES     YES
     SOP_CTLR_STATE      NO      NO      NO      NO      NO      NO      YES     YES
     SOP_GETMAP_SZ       NO      NO      NO      NO      NO      YES     YES     YES
     SOP_GETMAP          NO      NO      NO      NO      NO      YES     YES     YES
     SOP_GET_LNK_STS     NO      NO      NO      NO      NO      YES     YES     YES
     SOP_GET_WWN         NO      NO      NO      NO      NO      NO      YES     YES
     SOP_FW_VERSION      NO      NO      NO      NO      NO      NO      NO      YES
     SOP_FW_DOWNLOAD     NO      NO      NO      NO      NO      NO      NO      YES


     Utilization By Program

     IOCTL               scsiha  scsiadminswap   scsiquiesce
     -------------------------------------------------------
     SOP_RESET           YES         NO          NO
     SOP_SCAN            YES         YES         YES
     SOP_DEBUGLEVEL      YES         NO          NO


     SOP_LIP             YES         NO          NO
     SOP_LIPRST          YES         NO          NO
     SOP_LPB             YES         NO          NO
     SOP_LPE             YES         NO          NO
     SOP_LPEALL          YES         NO          NO
     SOP_QUIESCE         NO          YES         YES
     SOP_QUIESCE_STATE   NO          YES         YES
     SOP_UNQUIESCE       NO          YES         YES
     SOP_GET_SCSI_PARMS  YES         NO          NO
     SOP_DISABLE         NO          NO          NO
     SOP_ENABLE          NO          NO          NO
     SOP_CTLR_STATE      NO          NO          NO
     SOP_GETMAP_SZ       YES         NO          NO
     SOP_GETMAP          YES         NO          NO
     SOP_GET_LNK_STS     YES         NO          NO

ATTRIBUTES
     The qlfc, fcadp, and ls drivers make the adapter's portname (sometimes
     known as the World Wide Name) available as a hardware graph attribute
     "_fc_portname" on the controller's bus vertex.  The attribute's value is
     8 bytes long and stored as a uint64_t.  See attr_get(2) for details on
     retrieving this value.


NOTES
     Since the driver provides direct access to the SCSI host adapter, the
     system administrator must be very careful in setting up the permissions
     on the device files, lest security holes occur, no checking is performed
     for potentially dangerous actions (bus reset, get data, send data, port
     bypass).  There should be no reason for non-superuser use of this driver
     interface.  Resetting a SCSI bus can affect currently running programs.
     Anything that is using a tape drive will be aborted when the bus is
     reset.

     As the ls driver supports both scsi and fibre channel, and therefore
     supports the union of scsi and fibre specific ioctls, only the board type
     specific ioctls are supported on any particular controller.

FILES
     /hw/scsi_ctlr/#/bus

SEE ALSO
     ds(7M) to issue SCSI commands directly to devices.
     this driver.


                                                                        Page 3