home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / ddkx86v5.zip / DDKX86 / SRC / DEV / DASD / OS2SCSI / SCSTRAT1.C < prev    next >
Encoding:
C/C++ Source or Header  |  1995-04-14  |  2.5 KB  |  101 lines

  1. /*DDK*************************************************************************/
  2. /*                                                                           */
  3. /* COPYRIGHT    Copyright (C) 1995 IBM Corporation                           */
  4. /*                                                                           */
  5. /*    The following IBM OS/2 WARP source code is provided to you solely for  */
  6. /*    the purpose of assisting you in your development of OS/2 WARP device   */
  7. /*    drivers. You may use this code in accordance with the IBM License      */
  8. /*    Agreement provided in the IBM Device Driver Source Kit for OS/2. This  */
  9. /*    Copyright statement may not be removed.                                */
  10. /*                                                                           */
  11. /*****************************************************************************/
  12. /*static char *SCCSID = "src/dev/dasd/os2scsi/scstrat1.c, scsy, ddk_subset, b_bdd.032 93/03/19";*/
  13. /**************************************************************************
  14.  *
  15.  * SOURCE FILE NAME =  SCSTRAT1.C
  16.  *
  17.  * DESCRIPTIVE NAME = OS2SCSI.DMD - OS/2 SCSI.SYS Emulation
  18.  *
  19.  *
  20.  *
  21.  * VERSION = V2.0
  22.  *
  23.  * DATE
  24.  *
  25.  * DESCRIPTION : Strategy 1 entry point and request router
  26.  *
  27.  *
  28.  *
  29. */
  30.  
  31. #define INCL_NOBASEAPI
  32. #define INCL_NOPMAPI
  33. #include "os2.h"
  34. #include "devcmd.h"
  35. #include "error.h"
  36. #include "strat2.h"
  37. #include "reqpkt.h"
  38. #include "scb.h"
  39. #include "iorb.h"
  40. #include "scsi.h"
  41. #include "scscsi.h"
  42. #include "scgen.h"
  43. #include "scproto.h"
  44.  
  45.  
  46. void near IDCEntry()
  47. {
  48.   PRPH          pRPH;
  49.  
  50.   _asm { mov word ptr pRPH[0], bx };
  51.   _asm { mov word ptr pRPH[2], es };
  52.  
  53.   DDRoute(pRPH, IDC_ENTRY);
  54.  
  55.   _asm {LEAVE};
  56.   _asm {retf};
  57. }
  58.  
  59. void near DDStrat1Entry()
  60. {
  61.   PRPH          pRPH;
  62.  
  63.   _asm { mov word ptr pRPH[0], bx };
  64.   _asm { mov word ptr pRPH[2], es };
  65.  
  66.   DDRoute(pRPH, STRAT1_ENTRY);
  67.  
  68.   _asm {LEAVE};
  69.   _asm {retf};
  70. }
  71.  
  72.  
  73. void near DDRoute(pRPH, EntryType)
  74. PRPH          pRPH;
  75. USHORT        EntryType;
  76. {
  77.   USHORT        Cmd, status;
  78.  
  79.   Cmd = pRPH->Cmd;
  80.  
  81.   /*----------------------------*/
  82.   /* Filter out invaid requests */
  83.   /*----------------------------*/
  84.  
  85.   switch (Cmd)
  86.   {
  87.      case CMDGenIOCTL:
  88.         status = f_DriveGenIOCtl(EntryType, pRPH);
  89.         break;
  90.  
  91.      case CMDInitBase:
  92.         status = f_DriveInit( (PRPINITIN) pRPH );
  93.         break;
  94.  
  95.      default:
  96.         status = STDON + STERR + ERROR_I24_BAD_COMMAND;
  97.   }
  98.   pRPH->Status = status;
  99. }
  100.  
  101.