Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

dc(7)

tc(7)



  gs(7)                               CLIX                               gs(7)



  NAME

    gs - Generic SCSI device driver

  DESCRIPTION

    The gs driver is the generic Small Computer System Interface (SCSI) driver
    that allows a process to send commands to SCSI devices connected to I/O
    processor (IOP) and quad-SCSI (QS) boards.

    The /dev/gs/s2u3 file is a typical special file used to access a SCSI
    device.  The SCSI ID is 2 and the Logical Unit Number (LUN) is 3.  The
    major and minor device formats are shown below.  CHAN defines a QS bus, or
    channel number.

    Major device format for peripherals connected to a QS:

                 _______________________________________________
                |  7 |   6 |   5 |   4 |   3 |   2 |   1 |   0 |
                |________________________________________|_____|
                |                                        |     |
                |   system defined major device number   |  QS |
                |________________________________________|_____|

    Minor device format for peripherals connected to a QS:

                 _______________________________________________
                |  7 |   6 |   5 |   4 |   3 |   2 |   1 |   0 |
                |__________|_________________|_________________|
                |          |                 |                 |
                |   CHAN   |      SCSI ID    |        LUN      |
                |__________|_________________|_________________|

    Major device format for peripherals connected to an IOP:

                 _______________________________________________
                |  7 |   6 |   5 |   4 |   3 |   2 |   1 |   0 |
                |______________________________________________|
                |                                              |
                |      system defined major device number      |
                |______________________________________________|

    Minor device format for peripherals connected to an IOP:

                 _______________________________________________
                |  7 |   6 |   5 |   4 |   3 |   2 |   1 |   0 |
                |__________|_________________|_________________|
                |          |                 |                 |
                |    IOP   |      SCSI ID    |        LUN      |
                |__________|_________________|_________________|




  2/94 - Intergraph Corporation                                              1






  gs(7)                               CLIX                               gs(7)



                |__________|_________________|_________________|

    The /dev/gs/s?u? special files provide access to the specified SCSI device
    connected to an IOP.

    The /dev/gs/qs?s?u? special files provide access to the specified SCSI
    device connected to a QS.

    The /dev/gs/scsi special file provides access to any SCSI device.  The
    file descriptor corresponding to this special file must be associated with
    a specific SCSI address through the ioctl() function before operations can
    be performed on it.  This file descriptor can be associated repeatedly.

    The ioctl(fildes, request, arg) function can be used for the following
    requests.  The structures described below are defined in <sys/gs.h>.

    GS_CONN      Associates fildes with the SCSI device indicated by the
                 integer pointed to by arg.  The SCSI device mask must comply
                 with the system-defined major/minor combinations.

    GS_CMD       Sends command to controller.  The arg parameter points to a
                 gsioc structure shown below:

                 struct gsioc {
                      unsigned char *dataaddr;    /* data address */
                      unsigned char *senseaddr;   /* sense address */
                      unsigned char *cmdaddr;     /* command address */
                      int           datasize;     /* data size */
                      int           sensesize;    /* sense size */
                      int           cmdsize;      /* command size */
                      char          dir;          /* xfer direction */
                      char          reterror;     /* return error */
                      int           retdatasize;  /* return data size */
                      int           retsensesize; /* return sense size */
                 };

                 The cmdaddr member contains a pointer to the SCSI command
                 buffer to be sent to the target device.  The dataaddr member
                 contains a pointer to the data buffer associated with the
                 command.  All size fields indicate requested byte counts.

                 The dir member indicates the direction of the data transfer.
                 B_READ indicates that data is being received from the SCSI
                 device.  B_WRITE indicates that data is being sent to the
                 SCSI device.  These constants are defined in <sys/buf.h>.

                 All size fields for returned data indicate the actual number
                 of bytes transferred.

                 Upon normal completion of a SCSI command, reterror is set to
                 0.  Otherwise, if the target SCSI device indicates a check



  2                                              Intergraph Corporation - 2/94






  gs(7)                               CLIX                               gs(7)



                 condition, the gs driver will automatically issue a request
                 sense command (0x03) and transfer the resulting sense data to
                 the address indicated in the senseaddr member of the gsioc
                 structure.  The reterror member will indicate one of the
                 following errors defined in <sys/scsi.h>:

                 [SCSI_ERR_TIMEOUT]
                        A SCSI bus timeout occurred during the request.

                 [SCSI_ERR_BUSY]
                        The SCSI device indicated a busy status.

                 [SCSI_ERR_HARDWARE]
                        The SCSI bus hardware failed.

                 [SCSI_ERR_RESERVE]
                        The SCSI device is currently reserved.

                 [SCSI_ERR_CHKCONDITION]
                        The SCSI device indicated a check condition.

                 [SCSI_ERR_BADCOUNT]
                        The transfer count is greater than the largest
                        transfer size.

                 [SCSI_ERR_RESET]
                        SCSI bus reset occurred during the request.

                 [SCSI_ERR_PARITY]
                        A SCSI bus parity error occurred during the request.

                 [SCSI_ERR_INVALID]
                        An internal driver error occurred.

                 [SCSI_ERR_SYNCHRONOUS]
                        A SCSI bus synchronous transfer error occurred during
                        the request.

                 [SCSI_ERR_ABORT]
                        The SCSI operation was aborted.

                 [SCSI_ERR_SYSBUS]
                        A system bus error occurred during the data transfer
                        phase of the SCSI operation.

                 [SCSI_ERR_SYSPARITY]
                        A system memory parity error occurred during the data
                        transfer phase of the SCSI operation.

                 [SCSI_ERR_CMDSIZE]
                        The SCSI command buffer size is illegal.



  2/94 - Intergraph Corporation                                              3






  gs(7)                               CLIX                               gs(7)



                 [SCSI_ERR_REJECT]
                        The SCSI operation was rejected by the peripheral.

    GS_MAXSIZE   Returns the maximum, 4096 byte aligned data transfer size for
                 a device.  The arg parameter points to an integer location
                 that is updated with the size in bytes.

  FILES

    /dev/gs/*   Generic special file for accessing a SCSI device.

  ERRORS

    Upon failure of either the open() or ioctl() function, errno is set to one
    of the following:

    [EINVAL]   The value of request is not a valid value for the ioctl()
               function.

    [EFAULT]   The arg parameter points to a nonwritable memory location for
               the ioctl() function.

    [EBUSY]    The specified SCSI address or LUN is currently busy for the
               open() or ioctl() function.

    [ENODEV]   The specified SCSI address or LUN does not exist for the open()
               or ioctl() function.

  RELATED INFORMATION

    Files:  dc(7), tc(7)























  4                                              Intergraph Corporation - 2/94




Typewritten Software • bear@typewritten.org • Edmonds, WA 98026