home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / aspio02.zip / hainq.c < prev    next >
C/C++ Source or Header  |  1999-08-17  |  2KB  |  83 lines

  1. /*
  2.  * $Source: r:/source/aspi/RCS/hainq.c,v $
  3.  * $Revision: 1.4 $
  4.  * $Date: 1999/08/18 00:14:22 $
  5.  * $Locker:  $
  6.  *
  7.  *    ASPI Interface Library, HOST ADAPTER INQUIRY
  8.  *
  9.  * $Log: hainq.c,v $
  10.  * Revision 1.4  1999/08/18 00:14:22  vitus
  11.  * - updated location of defines.h (moved)
  12.  * - changed function comments to new layout
  13.  *
  14.  * Revision 1.3  1997/09/22 02:25:49  vitus
  15.  * commented
  16.  *
  17.  * Revision 1.2  1997/09/18 01:59:34  vitus
  18.  * changed to new header file names
  19.  *
  20.  * Revision 1.1  1997/09/08 02:02:58  vitus
  21.  * Initial revision
  22.  * ----------------------------------------
  23.  * Sample code to demonstrate use of ASPI Interface.
  24.  */
  25. static char const id[]="$Id: hainq.c,v 1.4 1999/08/18 00:14:22 vitus Exp $";
  26.  
  27. #include <string.h>
  28.  
  29. #define INCL_DOS
  30. #include <os2.h>
  31.  
  32. #include "../lib/defines.h"
  33. #include "scsi.h"
  34. #include "srb.h"
  35. #include "aspio.h"
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42. /*# ----------------------------------------------------------------------
  43.  * AspiHAInq(ha,srb)
  44.  *
  45.  * PARAMETER
  46.  *    ha    host adapter index
  47.  *    srb    see ASPI spec
  48.  *
  49.  * RETURNS
  50.  *    APIRET
  51.  *
  52.  * GLOBAL
  53.  *    (none)
  54.  *
  55.  * DESPRIPTION
  56.  *    Issues ADAPTER INQUIRY SRB to ASPI interface.  As this
  57.  *    calls returns more information than is feasable
  58.  *    to return via stack parameters the complete SRB
  59.  *    is parameter.
  60.  *
  61.  * REMARKS
  62.  */
  63. PUBLIC APIRET _System
  64. AspiHAInq(UCHAR ha,PASPI_SRB_INQUIRY srb)
  65. {
  66.     APIRET    rc;
  67.  
  68.     memset(srb, 0, sizeof(*srb));
  69.     srb->SRBHdr.CommandCode = ASPI_CMD_ADAPTER_INQUIRY;
  70.     srb->SRBHdr.AdapterIndex  = ha;
  71.     srb->SRBHdr.ASPIReqFlags = 0;        /* no flags set */
  72.  
  73.     rc = AspiSendSRB(&srb->SRBHdr, sizeof(*srb));
  74.  
  75.     if( rc == 0 )
  76.     {
  77.     if( srb->SRBHdr.ASPIStatus != ASPI_STATUS_NO_ERROR )
  78.         rc = 0xF0000000 | srb->SRBHdr.ASPIStatus;
  79.     }
  80.  
  81.     return rc;
  82. }
  83.