home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 4 Drivers / 04-Drivers.zip / scsiopt2.zip / str1.c < prev   
C/C++ Source or Header  |  1997-12-16  |  3KB  |  139 lines

  1. /*
  2.  * $Source: e:/source/driver/perf/RCS/str1.c,v $
  3.  * $Revision: 1.3 $
  4.  * $Date: 1997/12/16 02:22:14 $
  5.  * $Author: vitus $
  6.  *
  7.  * Strategy Level 1 code.
  8.  *
  9.  * $Log: str1.c,v $
  10.  * Revision 1.3  1997/12/16 02:22:14  vitus
  11.  * - renamed source files
  12.  *
  13.  * Revision 1.2  1997/12/06 00:42:23  vitus
  14.  * - enabled support for WatCom C
  15.  *
  16.  * Revision 1.1  1997/06/04 23:44:55  vitus
  17.  * Initial revision
  18.  * ----------------------------------------
  19.  * Author: Vitus Jensen, 2:2474/424, 1997
  20.  */
  21. #pragma off (unreferenced)
  22. static char vcid[]="$Id: str1.c,v 1.3 1997/12/16 02:22:14 vitus Exp $";
  23. #pragma on (unreferenced)
  24.  
  25.  
  26. /*#define INCL_NOBASEAPI*/
  27. #define INCL_DOSERRORS
  28. #define INCL_NOPMAPI
  29. #include <os2.h>
  30.  
  31. #include <devcmd.h>
  32.  
  33. #define INCL_INITRP_ONLY
  34. #include <reqpkt.h>
  35.  
  36. #include <iorb.h>
  37. #include <addcalls.h>
  38. #if defined(__WATCOMC__)
  39. # include <devhelp.h>
  40. typedef USHORT NEAR *    NPUSHORT;
  41. typedef VOID NEAR *    NPVOID;
  42. #else
  43. # include <dhcalls.h>
  44. #endif
  45.  
  46. #include "scsiopt.h"
  47. #include "proto.h"
  48. #include "extern.h"
  49.  
  50. /* To skip including all request packets... */
  51. extern USHORT NEAR    GenIOCtl(PRPH pRPH);
  52.  
  53.  
  54.  
  55.  
  56. /*
  57.  * NAME
  58.  *    Shutdown
  59.  * CALL
  60.  *    Shutdown(rph)
  61.  * PARAMETER
  62.  *    rph        request header
  63.  * RETURNS
  64.  *    STATUS_DONE
  65.  * GLOBAL
  66.  *    none
  67.  * DESPRIPTION
  68.  *    The system starts or ends shutdown state.  There is currently
  69.  *    nothing special we would like to do.
  70.  *
  71.  * REMARKS
  72.  */
  73. PRIVATE USHORT NEAR
  74. Shutdown(PRPH const rph)
  75. {
  76.     /* What to do? */
  77.  
  78.     return STATUS_DONE;
  79. }
  80.  
  81.  
  82.  
  83.  
  84.  
  85.  
  86. /* **********************************************************************
  87.  * **** Public Entries **************************************************
  88.  * ******************************************************************* */
  89.  
  90.  
  91. /*
  92.  * NAME
  93.  *    Strategy
  94.  * CALL
  95.  *    Strategy(rph)
  96.  * PARAMETER
  97.  *    rph        request header
  98.  * RETURNS
  99.  *    nothing
  100.  * GLOBAL
  101.  *    none
  102.  * DESPRIPTION
  103.  *    Entry point for strategy level 1 requests.  Only
  104.  *    some commands are supported.
  105.  * REMARKS
  106.  *    Called by assembler stub.
  107.  */
  108. PUBLIC void NEAR _Cdecl
  109. Strategy(PRPH rph)
  110. {
  111.     switch( rph->Cmd )
  112.     {
  113.       case CMDInitBase:
  114.     if( (fDriverFlags & DF_INITDONE) )
  115.         rph->Status = STDON | STERR | ERROR_I24_BAD_COMMAND;
  116.     else
  117.         rph->Status = InitBase( (PRPINITIN)rph );
  118.     break;
  119.  
  120.       case CMDShutdown:
  121.     rph->Status = Shutdown( rph );
  122.     break;
  123.  
  124.       case CMDOpen:
  125.       case CMDClose:
  126.     rph->Status = STATUS_DONE;
  127.     break;
  128.  
  129.       case CMDGenIOCTL:
  130.     rph->Status = GenIOCtl( rph );
  131.     break;
  132.  
  133.       default:
  134.     rph->Status = STDON | STERR | ERROR_I24_BAD_COMMAND;
  135.     break;
  136.     }
  137.     return;
  138. }
  139.