Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

intro(3)

sif_open(3)

sif_close(3)

sif_setup(3)

sif_cancel(3)

sif_lowmembuf_nw(3)

xsif(7)



  sif_scan_mem(3)                     CLIX                     sif_scan_mem(3)



  NAME

    sif_scan_mem, sif_scan_mem_nw - Transfers data from scanner to memory

  LIBRARY

    Intergraph XIO Library (libix.a)

  SYNOPSIS

    #include <sys/xio/xerr.h>

    #include <sys/xio/xio.h>

    int sif_scan_mem(
      int channel ,
      int dcnt ,
      int timeout ,
      int *xfcnt ,
      char *dbuf );

    int sif_scan_mem_nw(
      int channel ,
      int dcnt ,
      int timeout ,
      int efn ,
      char *dbuf ,
      struct xiosb *xiosb; );

  PARAMETERS

    channel   Specifies which Scanner Interface (SIF) board on which to start
              the scan.  The channel numbers start with 0.  Therefore the
              largest valid channel is one less than the number of SIF boards
              in the system.

    dcnt      Indicates the byte count to be transferred and must be a
              multiple of the linewidth specified in sif_setup().

    timeout   Indicates the time limit in 1/60-second intervals for the data
              transfer.  Any transfer that takes longer is aborted and an
              appropriate status is returned.  A timeout value of 0 disables
              the timeout function.

    xfcnt     Upon completion of the synchronous request, indicates the number
              of bytes transferred.

    dbuf      Points to the buffer to which data is being transferred.  The
              buffer must begin on a longword boundary.  This pointer is not
              used if the driver is in low memory mode.  (See sif_setup(3) for
              details.)



  2/94 - Intergraph Corporation                                              1






  sif_scan_mem(3)                     CLIX                     sif_scan_mem(3)



    sfn       Specifies the event flag number associated with the request.

    xiosb     Points to the xiosb structure updated when the request
              completes.  (See intro(3).)

  DESCRIPTION

    The sif_scan_mem() and sif_scan_mem_nw() functions provide a mechanism for
    transferring data directly from the scanner to virtual memory.  The
    specified SIF channel will move the data.  The channel parameter must have
    been opened with sif_open().

    The sif_scan_mem() function is the synchronous version of the routine.  It
    waits until the transfer is complete before returning.  The
    sif_scan_mem_nw() function is the asynchronous version.  After the
    initiating transfer, it returns back to the user who must use the XIO
    event routines to check for completion of the transfer.

    If sif_setup() was used to put the driver into low memory mode,
    sif_scan_mem() cannot be used.  In low memory mode, the driver expects
    buffers to be passed to it with sif_lowmembuf_nw().  This cannot happen
    with sif_scan_mem() since it will wait until the scan finishes before
    returning.

  EXAMPLES

    The following example shows how to start a scan both synchronously and
    asynchronously:

    /*
     * Open sif device, do initialization code
     */

    /*
     * Synchronous call
     */
    sync_err = sif_scan_mem(chan, cnt, 300, &xcnt, buf1);

    /*
     * Asynchronous call
     */
    async_err = sif_scan_mem_nw(chan, cnt, 300, efn, buf2, &main_xiosb);


  FILES

    /usr/include/sys/xio/xerr.h
           XIO error file

  RETURN VALUES




  2                                              Intergraph Corporation - 2/94






  sif_scan_mem(3)                     CLIX                     sif_scan_mem(3)



    Upon successful completion of the synchronous request, a value of 0 is
    returned.  Otherwise, one of the failure codes listed in the ERRORS
    section is returned.

    If the XIO system accepts the asynchronous request, the request will
    return a value of 0.  Otherwise, XIO_FAILURE is returned.  Upon completion
    of an accepted request, the status member of the xiosb structure is set to
    0 if successful, or one of the failure codes listed in the ERRORS section
    if unsuccessful.

  ERRORS

    The sif_scan_mem() and sif_scan_mem_nw() functions fail if one of the
    following is true:

    [XIO_FAILURE]
           The system does not contain the driver needed to support this
           request or efn is invalid.

    [SIF_CHANNEL_INVALID]
           The specified channel is beyond the maximum allowed.

    [SIF_CHANNEL_NOT_OPEN]
           The specified channel is not open for this process.

    [BAD_DATA_BUFFER_ADDRESS]
           The data buffer is either not longword aligned or points to a
           nonwritable memory space.

    [BAD_DATA_BUFFER_COUNT]
           The byte count is not a multiple of linewidth from sif_setup().

    [PAGE_LOCK_FAILED]
           Not enough physical memory for this request is available at this
           time.

    [SIF_CANCELED]
           The request was canceled with sif_cancel() or sif_close().

    [SIF_PIX_PER_LINE_ERROR]
           The scanner transmitted an incorrect number of pixels per scanline.

    [SIF_LINE_PER_SWATH_ERROR]
           The scanner transmitted an incorrect number of scanlines per swath.

    [SIF_RED_PARITY_ERROR]
           A parity error occurred on the red component input.

    [SIF_GREEN_PARITY_ERROR]
           A parity error occurred on the green component input.




  2/94 - Intergraph Corporation                                              3






  sif_scan_mem(3)                     CLIX                     sif_scan_mem(3)



    [SIF_BLUE_PARITY_ERROR]
           A parity error occurred on the blue component input.

    [SIF_CYCLE_ERROR]
           A hardware handshake error occurred on the transfer or the system
           is in a low memory mode and buffers were not passed to the driver
           fast enough to keep up with the hardware.

    [SIF_TIMEOUT]
           The timeout expired before the transfer completed.

  RELATED INFORMATION

    Functions:  intro(3), sif_open(3), sif_close(3), sif_setup(3),
    sif_cancel(3), sif_lowmembuf_nw(3)

    Files:  xsif(7)





































  4                                              Intergraph Corporation - 2/94




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