home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / cdrom.zip / DDK / BASE / SRC / DEV / DASD / CDROM / ATAPI / atapidat.c < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-10  |  23.0 KB  |  461 lines

  1. /**************************************************************************
  2.  *
  3.  * SOURCE FILE NAME = ATAPIDAT.C
  4.  *
  5.  * DESCRIPTION : Global Data for ATAPI driver
  6.  *
  7.  *
  8.  * Copyright : COPYRIGHT IBM CORPORATION, 1991, 1992
  9.  *             LICENSED MATERIAL - PROGRAM PROPERTY OF IBM
  10.  *             REFER TO COPYRIGHT INSTRUCTION FORM#G120-2083
  11.  *             RESTRICTED MATERIALS OF IBM
  12.  *             IBM CONFIDENTIAL
  13.  *
  14.  * VERSION = 1.0
  15.  *
  16.  * DATE
  17.  *
  18.  * DESCRIPTION :
  19.  *
  20.  * Purpose:
  21.  *
  22.  *
  23.  * CHANGE ACTIVITY =
  24.  *   DATE      FLAG        DEFECT  CHANGE DESCRIPTION
  25.  *   --------  ----------  ------  --------------------------------------
  26.  *   08/22/94  V@93531     93531   1) Suspend/Resume logic passes IRQ handler
  27.  *                                 address. 2) DRQ polling is not valid while
  28.  *                                 BSY bit set.
  29.  *   04/03/95  @V117508    117508  Add #defines to include MCA version of driver
  30.  *   07/27/95  @V132280            Added HWRESOURCE to fix Suspend/Resume.
  31.  *   04/05/96  @V151168            Merged warm dock/swap code.
  32.  *   05/09/96  @V153151            Moved some code and data from init to
  33.  *                                 run-time residency.
  34.  *   05/24/96  @V155162            Thinkpad docking/swapping IDE update.
  35.  ***************************************************************************/
  36. #define INCL_NOBASEAPI
  37. #define INCL_NOPMAPI
  38. #include "os2.h"
  39. #include "dos.h"
  40. #include "dskinit.h"
  41.  
  42. #include "iorb.h"
  43. #include "addcalls.h"
  44. #include "dhcalls.h"
  45. #include "apmcalls.h"                                               /*@V151168*/
  46.  
  47. #define INCL_INITRP_ONLY
  48. #include "reqpkt.h"
  49.  
  50. #include "scsi.h"
  51. #include "cdbscsi.h"
  52.  
  53. #include "atapicon.h"
  54. #include "atapireg.h"
  55. #include "atapityp.h"
  56. #include "atapiext.h"
  57. #include "atapipro.h"
  58.  
  59. ACBPTRS      ACBPtrs[MAX_ADAPTERS] = { { 0, &AdapterIRQ0 },
  60.                                        { 0, &AdapterIRQ1 },
  61.                                        { 0, &AdapterIRQ2 },
  62.                                        { 0, &AdapterIRQ3 } };
  63. USHORT       startresume           = 0;
  64. USHORT       startsuspend          = 0;
  65. PFN          Device_Help           = 0L;
  66. USHORT       ADDHandle             = 0;
  67. USHORT       cAdapters             = 0;
  68. USHORT       cUnits                = 0;
  69. USHORT       InitActive            = 0;
  70. USHORT       InitIOComplete        = 0;
  71. USHORT       MachineID             = 0;
  72. USHORT       Calibrate             = 0;
  73. ULONG        WaitDRQCount          = 0;
  74. ULONG        WaitBSYCount          = 0;                              /*V@93531*/
  75. ULONG        CheckReadyCount       = 0;
  76. ULONG        IODelayCount          = 0;
  77. ULONG        ElapsedTimerHandle    = 0;
  78. UCHAR        AdapterName[17]       = "ATAPI CDROM"; /* Adapter Name ASCII string */
  79. LIN          plDataSeg             = 0;
  80. LIN          plSwapCode            = 0;
  81. USHORT       SwapCodeLen           = 0;
  82. USHORT       ADDLockCount          = 0;
  83. LIN          plADDLockHandle       = 0;
  84. #define      TASKTIME               -1L
  85. PULONG       pNestedIntCount       = 0;
  86. USHORT       cInt                  = 0;
  87. UCHAR        ADDLockHandle[12]     = { 0 };
  88.  
  89. UCHAR        SenseDataBuf[SENSE_DATA_BYTES] = { 0 };
  90. ULONG        ppSenseDataBuf          = 0;
  91. SCATGATENTRY SenseDataSGList         = { 0, SENSE_DATA_BYTES };
  92.  
  93. USHORT AddSenseDataMap[] = {
  94.    0,                                /* 00h No sense information              */
  95.    IOERR_RBA_ADDRESSING_ERROR,       /* 01h No index/sector signal            */
  96.    IOERR_RBA_ADDRESSING_ERROR,       /* 02h No seek complete                  */
  97.    IOERR_RBA_CRC_ERROR,              /* 03h Write fault                       */
  98.    IOERR_UNIT_NOT_READY,             /* 04h Drive not ready                   */
  99.    IOERR_ADAPTER_DEVICE_TIMEOUT,     /* 05h LUN not selected                  */
  100.    IOERR_RBA_ADDRESSING_ERROR,       /* 06h No track zero found                           */
  101.    IOERR_ADAPTER_REFER_TO_STATUS,    /* 07h Multiple drives selected          */
  102.    IOERR_ADAPTER_DEVICE_TIMEOUT,     /* 08h Logical unit communication failure*/
  103.    IOERR_RBA_ADDRESSING_ERROR,       /* 09h Track following error             */
  104.    IOERR_ADAPTER_REFER_TO_STATUS,    /* 0Ah Reserved                          */
  105.    IOERR_ADAPTER_REFER_TO_STATUS,    /* 0Bh Reserved                          */
  106.    IOERR_RBA_CRC_ERROR,              /* 0Ch Write Error                       */
  107.    IOERR_ADAPTER_REFER_TO_STATUS,    /* 0Dh Reserved                          */
  108.    IOERR_ADAPTER_REFER_TO_STATUS,    /* 0Eh Reserved                          */
  109.    IOERR_ADAPTER_REFER_TO_STATUS,    /* 0Fh Reserved                          */
  110.    IOERR_RBA_ADDRESSING_ERROR,       /* 10h ID CRC or ECC error               */
  111.    IOERR_RBA_CRC_ERROR,              /* 11h Unrecovered Read error            */
  112.    IOERR_RBA_ADDRESSING_ERROR,       /* 12h No address mark found             */
  113.    IOERR_RBA_ADDRESSING_ERROR,       /* 13h No addr mark in data field        */
  114.    IOERR_RBA_ADDRESSING_ERROR,       /* 14h No record found                   */
  115.    IOERR_RBA_ADDRESSING_ERROR,       /* 15h Seek positioning error            */
  116.    IOERR_RBA_ADDRESSING_ERROR,       /* 16h Data synchroniztion mark error    */
  117.    IOERR_RBA_CRC_ERROR,              /* 17h Recovered read w/ retries         */
  118.    IOERR_RBA_CRC_ERROR,              /* 18h Recovered read data w/correction  */
  119.    IOERR_ADAPTER_REFER_TO_STATUS,    /* 19h Defect list error                 */
  120.    IOERR_ADAPTER_REFER_TO_STATUS,    /* 1Ah Parameter overrun                 */
  121.    IOERR_ADAPTER_DEVICEBUSCHECK,     /* 1Bh Synchronous transfer err          */
  122.    IOERR_ADAPTER_REFER_TO_STATUS,    /* 1Ch Primary defect list not found     */
  123.    IOERR_ADAPTER_REFER_TO_STATUS,    /* 1Dh Compare error                     */
  124.    IOERR_RBA_ADDRESSING_ERROR,       /* 1Eh Recovered ID with ECC correction  */
  125.    IOERR_ADAPTER_REFER_TO_STATUS,    /* 1Fh Reserved                          */
  126.    IOERR_CMD_SYNTAX,                 /* 20h Invalid command op code           */
  127.    IOERR_RBA_ADDRESSING_ERROR,       /* 21h Illegal logical blk addr          */
  128.    IOERR_CMD_SYNTAX,                 /* 22h Illegal func for dev type         */
  129.    IOERR_ADAPTER_REFER_TO_STATUS,    /* 23h Reserved                          */
  130.    IOERR_CMD_SYNTAX,                 /* 24h Illegal field in CDW              */
  131.    IOERR_CMD_SYNTAX,                 /* 25h Invalid LUN                       */
  132.    IOERR_CMD_SYNTAX,                 /* 26h Invalid param list field          */
  133.    IOERR_MEDIA_WRITE_PROTECT,        /* 27h Write protected                   */
  134.    IOERR_MEDIA_CHANGED,              /* 28h Medium changed                    */
  135.    IOERR_DEVICE_RESET,               /* 29h Power on reset or bus device reset*/
  136.    IOERR_MEDIA_CHANGED,              /* 2Ah Mode select parameters changed    */
  137.    IOERR_ADAPTER_REFER_TO_STATUS,    /* 2Bh Reserved                          */
  138.    IOERR_ADAPTER_REFER_TO_STATUS,    /* 2Ch Reserved                          */
  139.    IOERR_ADAPTER_REFER_TO_STATUS,    /* 2Dh Reserved                          */
  140.    IOERR_ADAPTER_REFER_TO_STATUS,    /* 2Eh Reserved                          */
  141.    IOERR_ADAPTER_REFER_TO_STATUS,    /* 2Fh Reserved                          */
  142.    IOERR_MEDIA_NOT_SUPPORTED,        /* 30h Incompatible cartridge            */
  143.    IOERR_MEDIA_NOT_FORMATTED,        /* 31h Medium format corrupted           */
  144.    IOERR_MEDIA_NOT_FORMATTED,        /* 32h No defect spare location available*/
  145.    IOERR_ADAPTER_REFER_TO_STATUS,    /* 33h Reserved                          */
  146.    IOERR_ADAPTER_REFER_TO_STATUS,    /* 34h Reserved                          */
  147.    IOERR_ADAPTER_REFER_TO_STATUS,    /* 35h Reserved                          */
  148.    IOERR_ADAPTER_REFER_TO_STATUS,    /* 36h Reserved                          */
  149.    IOERR_ADAPTER_REFER_TO_STATUS,    /* 37h Reserved                          */
  150.    IOERR_ADAPTER_REFER_TO_STATUS,    /* 38h Reserved                          */
  151.    IOERR_ADAPTER_REFER_TO_STATUS,    /* 39h Reserved                          */
  152.    IOERR_MEDIA_NOT_PRESENT,          /* 3Ah Medium Not Present                */
  153.    IOERR_ADAPTER_REFER_TO_STATUS,    /* 3Bh Reserved                          */
  154.    IOERR_ADAPTER_REFER_TO_STATUS,    /* 3Ch Reserved                          */
  155.    IOERR_ADAPTER_REFER_TO_STATUS,    /* 3Dh Reserved                          */
  156.    IOERR_UNIT_NOT_READY,             /* 3Eh LUN  not self-configured yet      */
  157.    IOERR_ADAPTER_REFER_TO_STATUS,    /* 3Fh Reserved                          */
  158.    IOERR_DEVICE_DIAGFAIL,            /* 40h RAM failure                       */
  159.    IOERR_DEVICE_DIAGFAIL,            /* 41h Data path diagnostic failure      */
  160.    IOERR_DEVICE_DIAGFAIL,            /* 42h Power-on diag failure             */
  161.    IOERR_DEVICE_DEVICEBUSCHECK,      /* 43h Message reject error              */
  162.    IOERR_DEVICE,                     /* 44h Internal controller error         */
  163.    IOERR_UNIT_NOT_READY,             /* 45h Select/reselect failed            */
  164.    IOERR_DEVICE_BUSY,                /* 46h Unsuccessful soft reset           */
  165.    IOERR_DEVICE_DEVICEBUSCHECK,      /* 47h SCSI interface parity error       */
  166.    IOERR_DEVICE_DEVICEBUSCHECK,      /* 48h Initiator detected error          */
  167.    IOERR_DEVICE_DEVICEBUSCHECK,      /* 49h Inappropriate/illegal message     */
  168.    IOERR_ADAPTER_REFER_TO_STATUS,    /* 50H - Reserved                      */
  169.    IOERR_ADAPTER_REFER_TO_STATUS,    /* 51H - Reserved                      */
  170.    IOERR_ADAPTER_REFER_TO_STATUS,    /* 52H - Reserved                      */
  171.    IOERR_ADAPTER_REFER_TO_STATUS,    /* 53H - Media Load or eject failed    */
  172.    IOERR_ADAPTER_REFER_TO_STATUS,    /* 54H - Reserved                      */
  173.    IOERR_ADAPTER_REFER_TO_STATUS,    /* 55H - Reserved                      */
  174.    IOERR_ADAPTER_REFER_TO_STATUS,    /* 56H - Reserved                      */
  175.    IOERR_ADAPTER_REFER_TO_STATUS,    /* 57H - Unable to recover TOC         */
  176.    IOERR_ADAPTER_REFER_TO_STATUS,    /* 58H - Reserved                      */
  177.    IOERR_ADAPTER_REFER_TO_STATUS,    /* 59H - Reserved                      */
  178.    IOERR_ADAPTER_REFER_TO_STATUS,    /* 5AH - Operator request/state change */
  179.    IOERR_ADAPTER_REFER_TO_STATUS,    /* 5BH - LOG exception                 */
  180.    IOERR_ADAPTER_REFER_TO_STATUS,    /* 5CH - Reserved                      */
  181.    IOERR_ADAPTER_REFER_TO_STATUS,    /* 5DH - Reserved                      */
  182.    IOERR_ADAPTER_REFER_TO_STATUS,    /* 5EH - Reserved                      */
  183.    IOERR_ADAPTER_REFER_TO_STATUS,    /* 5FH - Reserved                      */
  184.    IOERR_ADAPTER_REFER_TO_STATUS,    /* 60H - Reserved                      */
  185.    IOERR_ADAPTER_REFER_TO_STATUS,    /* 61H - Reserved                      */
  186.    IOERR_ADAPTER_REFER_TO_STATUS,    /* 62H - Reserved                      */
  187.    IOERR_ADAPTER_REFER_TO_STATUS,    /* 63H - End of User area encountered  */
  188.    IOERR_MEDIA_NOT_SUPPORTED         /* 64H - Illegal Mode for this track   */
  189.    };
  190.  
  191.    USHORT       MaxAddSenseDataEntry =
  192.                                   ( sizeof(AddSenseDataMap) / sizeof(USHORT) );
  193.  
  194. USHORT       LevelInterrupt= 0;                                    /*@V117508*/
  195.  
  196. USHORT       ACBPoolAvail          = ACB_POOL_SIZE + TIMER_POOL_SIZE +
  197.                                      UNITINFO_POOL_SIZE;
  198.  
  199. UCHAR        ACBPool[ACB_POOL_SIZE + TIMER_POOL_SIZE +
  200.                      UNITINFO_POOL_SIZE] = { 0 };
  201.  
  202. NPBYTE       npACBPool             = ACBPool;
  203.  
  204. /* The throw away section begins with npACBPool.  (At the end of init, it has
  205.    been incremented by the amount of used memory for internal structures.  Any
  206.    unused portion, and all the init data is then thrown away.) */
  207.  
  208. UCHAR        ScratchBuf[SCRATCH_BUF_SIZE]  = { 0 };
  209. UCHAR        ScratchBuf1[SCRATCH_BUF_SIZE]  = { 0 };
  210.  
  211. USHORT       ComPort               = COM2ADDRESS;
  212. USHORT       cResets               = 0;
  213. USHORT       AdaptersForced        = 0;                             /*@V151168*/
  214.  
  215. ATBL         AdapterTable[MAX_ADAPTERS] =
  216. {
  217.    /*┌──────────────────────────────────────────────────────────────────────┐
  218.      │ Port, IRQ, IRQHandler,       Flags,            Status, npACB, cUnits │
  219.      │                                       Unit Flags, Unit Status        │
  220.      │                                       Unit Flags, Unit Status        │
  221.      └──────────────────────────────────────────────────────────────────────┘*/
  222.      {0,     0, &AdapterIRQ0, ATBF_DISABLED | ATBF_SHARED_ADAPTER, 0, 0 ,0,
  223.                                                   {{0, UTS_NOT_PRESENT},
  224.                                                    {0, UTS_NOT_PRESENT}} },
  225.  
  226.      {0,     0, &AdapterIRQ1, ATBF_DISABLED | ATBF_SHARED_ADAPTER, 0, 0 ,0,
  227.                                                   {{0, UTS_NOT_PRESENT},
  228.                                                    {0, UTS_NOT_PRESENT}} },
  229.  
  230.      {0,     0, &AdapterIRQ2, ATBF_DISABLED | ATBF_SHARED_ADAPTER, 0, 0 ,0,
  231.                                                   {{0, UTS_NOT_PRESENT},
  232.                                                    {0, UTS_NOT_PRESENT}} },
  233.  
  234.      {0,     0, &AdapterIRQ3, ATBF_DISABLED | ATBF_SHARED_ADAPTER, 0, 0 ,0,
  235.                                                   {{0, UTS_NOT_PRESENT},
  236.                                                    {0, UTS_NOT_PRESENT}} }
  237. };
  238.  
  239.  
  240. /* Teac CD-40E internal ThinkPad 755CD support data */              /*@V151168*/
  241.                                                                     /*@VVVVVVV*/
  242. /* SCSI Sense Data */
  243. SCSI_REQSENSE_DATA   no_audio_status = {
  244. /* Error,   Sense Key,       Additional Len,  ASC,  ASCQ */
  245. /* ----     ----             ----             ----  ---- */
  246.    0x70, 0, 0x00, {0,0,0,0}, 0x0a, {0,0,0,0}, 0x00, 0x15, 0, {0,0,0}};
  247.  
  248. SCSI_REQSENSE_DATA   medium_not_present = {
  249.    0x70, 0, 0x02, {0,0,0,0}, 0x0a, {0,0,0,0}, 0x3a, 0x00, 0, {0,0,0}};
  250.  
  251. SCSI_REQSENSE_DATA   invalid_field_in_cmd_pkt = {
  252.    0x70, 0, 0x05, {0,0,0,0}, 0x0a, {0,0,0,0}, 0x24, 0x00, 0, {0,0,0}};
  253.  
  254. SCSI_REQSENSE_DATA   invalid_cmd_op_code = {
  255.    0x70, 0, 0x05, {0,0,0,0}, 0x0a, {0,0,0,0}, 0x20, 0x00, 0, {0,0,0}};
  256.  
  257.  
  258. /* SCSI Inquiry data */
  259. SCSI_INQDATA   inquiry_data = {
  260.    0x05, 0x80, 0x00, 0x01, 0x1f, 0x00, 0x00, 0x00,
  261.    "TEAC    ",                /* Vendor Identification */
  262.    "CD-40E          ",        /* Product Identification */
  263.    "1.0J"                     /* Product Revision */
  264. };
  265.  
  266.  
  267. /* SCSI Mode Sense data */
  268. UCHAR    mode_sense_10_page_cap[LEN_MODE_SENSE_10] = {
  269.    0x00, 0x16, 0x71, 0x00, 0x00, 0x00, 0x00, 0x00,
  270.    0x2a, 0x0e, 0x00, 0x00, 0x71, 0x63, 0x29, 0x00,
  271.    0x01, 0x61, 0x00, 0x10, 0x00, 0x40, 0x01, 0x61
  272. };
  273.  
  274.  
  275. /* ATAPI Identify Data */
  276. IDENTIFYDATA   atapi_identify_data = {
  277.    {0x00, 0x02, 0x01, 0x05, 0x02},  /* General Config. */
  278.    {0},
  279.    "                    ",                      /* Serial Number */
  280.    0x03, 0x80, 0x00,
  281.    "1.0J    ",                                  /* Firmware Revision */
  282.    "CD-40E                                  ",  /* Model Number */
  283.    {0}, 0x0f00, 0x00, 0x0300, 0x0200, 0x02,
  284.    {0}, {0}, {0},
  285.    0x0107, 0x03, 0x01, 0x96, 0xc8, 0xb4, 0xb4,
  286.    {0}                                                              /*@AAAAAAA*/
  287. };    /* End of Teac CD-40E support for ThinkPad 755CD */           /*@V151168*/
  288.  
  289. IORB_ADAPTER_PASSTHRU InitIORB               = { 0 };               /*@V153151*/
  290. SCATGATENTRY          IdentifySGList         = { 0, 512 };          /*@V153151*/
  291. /*
  292. ** Initialize device strings.
  293. */
  294. CHAR        MatshitaID[]           = "                    MATSHITA CR-571 0.2d"; /*@V155162*/
  295. CHAR        Nec01ID[]              = "NEC                 CD-ROM DRIVE:260    "; /*@V155162*/
  296. CHAR        Nec01FWID[]            = "1.01    ";                                 /*@V155162*/
  297. CHAR        Nec02ID[]              = "EN C                DCR-MOD IREV2:06    "; /*@V155162*/
  298. CHAR        BlankSerial[]          = "                    ";                     /*@V155162*/
  299. UCHAR       TimersCalibrated       = 0;                             /* moved for @V155162*/
  300. ULONG       CalibrateTimerHandle   = 0;                             /* moved for @V155162*/
  301. ULONG       CallWorkerSync         = 0;                             /* moved for @V155162*/
  302. ULONG       CallWorker             = 0;                             /* moved for @V155162*/
  303.  
  304. /*
  305. ** Start of Initialization Data
  306. **
  307. ** This is the address of the discardable data.  All data
  308. ** references after this point will be discarded after init.
  309. ** The throw away section begins with BeginInitData.  At the
  310. ** end of init, it has been incremented by the amount of used
  311. ** memory for internal structures.  Any unused portion, and
  312. ** all the init data is then thrown away.
  313. */
  314. UCHAR        BeginInitData         = 0;
  315.  
  316. #ifdef PRE_RELEASE
  317. BOOL         Verbose               = TRUE;
  318. #else
  319. BOOL         Verbose               = FALSE;
  320. #endif
  321. BOOL         Installed             = FALSE;
  322. BOOL         Force                 = FALSE;                         /*@V151168*/
  323.  
  324. IDCTABLE    DDTable                = { 0 };
  325.  
  326.  
  327. #define      MSG_REPLACEMENT_STRING  1178
  328.  
  329.  
  330. MSGTABLE     InitMsg               = { MSG_REPLACEMENT_STRING,
  331.                                        1,
  332.                                        0                      };
  333.  
  334. UCHAR AdptMsg0[] = "OK";
  335. UCHAR AdptMsg1[] = "Adapter not located";
  336. UCHAR AdptMsg2[] = "Adapter skipped";
  337. UCHAR AdptMsg3[] = "Failed to set IRQ";
  338.  
  339. NPSZ AdptMsgs[] = { AdptMsg0,
  340.                     AdptMsg1,
  341.                     AdptMsg2,
  342.                     AdptMsg3 };
  343.  
  344. UCHAR UnitMsg0[] = "OK - Device Filtered";
  345. UCHAR UnitMsg1[] = "";
  346.  
  347. NPSZ UnitMsgs[] = { UnitMsg0,
  348.                     UnitMsg1 };
  349.  
  350. UCHAR ProtocolTypeMsg0[] = "     ATA";
  351. UCHAR ProtocolTypeMsg1[] = "     ATA";
  352. UCHAR ProtocolTypeMsg2[] = "   ATAPI";
  353. UCHAR ProtocolTypeMsg3[] = "Reserved";
  354.  
  355. NPSZ ProtocolTypeMsgs[] = { ProtocolTypeMsg0,
  356.                             ProtocolTypeMsg1,
  357.                             ProtocolTypeMsg2,
  358.                             ProtocolTypeMsg3 };
  359.  
  360. UCHAR DeviceTypeMsg0[] = "             Reserved";
  361. UCHAR DeviceTypeMsg1[] = " Direct-Access Device";
  362. UCHAR DeviceTypeMsg2[] = "               CD-ROM";
  363. UCHAR DeviceTypeMsg3[] = "Optical Memory Device";
  364. UCHAR DeviceTypeMsg4[] = "              Unknown";
  365.  
  366. NPSZ DeviceTypeMsgs[] = { DeviceTypeMsg1, DeviceTypeMsg0,
  367.                           DeviceTypeMsg0, DeviceTypeMsg0,
  368.                           DeviceTypeMsg0, DeviceTypeMsg2,
  369.                           DeviceTypeMsg0, DeviceTypeMsg3,
  370.                           DeviceTypeMsg0, DeviceTypeMsg0,
  371.                           DeviceTypeMsg0, DeviceTypeMsg0,
  372.                           DeviceTypeMsg0, DeviceTypeMsg0,
  373.                           DeviceTypeMsg0, DeviceTypeMsg0,
  374.                           DeviceTypeMsg0, DeviceTypeMsg0,
  375.                           DeviceTypeMsg0, DeviceTypeMsg0,
  376.                           DeviceTypeMsg0, DeviceTypeMsg0,
  377.                           DeviceTypeMsg0, DeviceTypeMsg0,
  378.                           DeviceTypeMsg0, DeviceTypeMsg0,
  379.                           DeviceTypeMsg0, DeviceTypeMsg0,
  380.                           DeviceTypeMsg0, DeviceTypeMsg0,
  381.                           DeviceTypeMsg0, DeviceTypeMsg4 };
  382.  
  383. UCHAR CMDDRQTypeMsg0[] = "Microprocessor DRQ";
  384. UCHAR CMDDRQTypeMsg1[] = "     Interrupt DRQ";
  385. UCHAR CMDDRQTypeMsg2[] = "   Accelerated DRQ";
  386. UCHAR CMDDRQTypeMsg3[] = "          Reserved";
  387.  
  388. NPSZ CMDDRQTypeMsgs[] = { CMDDRQTypeMsg0,
  389.                           CMDDRQTypeMsg1,
  390.                           CMDDRQTypeMsg2,
  391.                           CMDDRQTypeMsg3 };
  392.  
  393. UCHAR        ParmErrMsg[]          = " Warning: IBMIDECD.FLT - Invalid CONFIG.SYS parameters";
  394. UCHAR        UninstallMsg[]        = " Warning: IBMIDECD.FLT - Driver did not load";
  395. #ifdef PRE_RELEASE
  396. UCHAR        VersionMsg[]          =
  397.             "╔══════════════════════════════════════════════════════════╗\r\n"
  398.             "║                                                          ║\r\n"
  399.             "║ PRE-RELEASE!!!                                           ║\r\n"
  400.             "║ IBM ATAPI (IDE) CDROM Filter for OS/2 2.x & 3.x (960405) ║\r\n"
  401.             "║                                                          ║\r\n"
  402.             "╚══════════════════════════════════════════════════════════╝\0";
  403. #else
  404. UCHAR        VersionMsg[]          =
  405.             "╔══════════════════════════════════════════════════════════╗\r\n"
  406.             "║                                                          ║\r\n"
  407.             "║ IBM ATAPI (IDE) CDROM Filter for OS/2 2.x & 3.x (960405) ║\r\n"
  408.             "║                                                          ║\r\n"
  409.             "╚══════════════════════════════════════════════════════════╝\0";
  410. #endif /* PRE_RELEASE */
  411. UCHAR        DevEqualsMsg[]        =
  412.                    "╔════════════════════════════════════════════════════╗\r\n"
  413.                    "║                                                    ║\r\n"
  414.                    "║ IBM ATAPI (IDE) CDROM Driver for OS/2 requires     ║\r\n"
  415.                    "║ the following statement in your config.sys file:   ║\r\n"
  416.                    "║                                                    ║\r\n"
  417.                    "║ BASEDEV=ibmidecd.flt                               ║\r\n"
  418.                    "║                                                    ║\r\n"
  419.                    "╚════════════════════════════════════════════════════╝\0";
  420.  
  421. UCHAR                 StringBuffer[80] = { 0 };
  422. UCHAR                 INTStringBuffer[80] = { 0 };
  423.  
  424. UCHAR        SearchKeytxt[]        = "IDE_0";
  425. HDRIVER      hDriver               = 0L;
  426. PFN          RM_Help               = 0L;
  427. PFN          RM_Help0              = 0L;
  428. PFN          RM_Help3              = 0L;
  429. ULONG        RMFlags               = 0L;
  430.  
  431. UCHAR  DrvrNameTxt[]     = "IBMIDECD.FLT";
  432. USHORT DrvrNameSize      = sizeof(DrvrNameTxt);
  433. UCHAR  DrvrDescriptTxt[] = "IBM Filter Driver for IDE ATAPI CDROMs";
  434. UCHAR  VendorNameTxt[]   = "IBM OS/2";
  435.  
  436. DRIVERSTRUCT DriverStruct =
  437. {
  438.    DrvrNameTxt,                              /* DrvrName                */
  439.    DrvrDescriptTxt,                          /* DrvrDescript            */
  440.    VendorNameTxt,                            /* VendorName              */
  441.    CMVERSION_MAJOR,                          /* MajorVer                */
  442.    CMVERSION_MINOR,                          /* MinorVer                */
  443.    1996,4,5,                                 /* Date                    */
  444.    0,                                        /* DrvrFlags               */
  445.    DRT_ADDDM,                                /* DrvrType                */
  446.    DRS_FILTER,                               /* DrvrSubType             */
  447.    NULL                                      /* DrvrCallback            */
  448. };
  449.  
  450. /*----------------------------------------------*/
  451. /* Device Description                           */
  452. /*----------------------------------------------*/
  453. UCHAR DevDescriptNameTxt[] = "ATAPI_0 IDE CDROM Drive";
  454.  
  455. DEVICESTRUCT DevStruct =
  456. {
  457.    DevDescriptNameTxt,   /* DevDescriptName; */
  458.    DS_FIXED_LOGICALNAME, /* DevFlags;        */
  459.    DS_TYPE_CDROM         /* DevFlags;        */
  460. };
  461.