/*DDK*************************************************************************/
/*                                                                           */
/* COPYRIGHT    Copyright (C) 1995 IBM Corporation                           */
/*                                                                           */
/*    The following IBM OS/2 WARP source code is provided to you solely for  */
/*    the purpose of assisting you in your development of OS/2 WARP device   */
/*    drivers. You may use this code in accordance with the IBM License      */
/*    Agreement provided in the IBM Device Driver Source Kit for OS/2. This  */
/*    Copyright statement may not be removed.                                */
/*                                                                           */
/*****************************************************************************/
/**************************************************************************
 *
 * SOURCE FILE NAME = CDPROTO.H
 *
 * DESCRIPTIVE NAME = C function prototypes for OS/2 CD-ROM Device Mgr
 *
 *
 * VERSION = V2.0
 *
 * DATE
 *
 * DESCRIPTION
 *
 *
 * FUNCTIONS
 *
 * ENTRY POINTS:
 *
 * DEPENDENCIES:
 *
 * NOTES
 *
 *
 * STRUCTURES
 *
 * EXTERNAL REFERENCES
 *
 * EXTERNAL FUNCTIONS
 *
*/

/*---------------------------------------*
 * Function declarations - Static Code   *
 *---------------------------------------*/
USHORT NEAR CD_DriveInit (PRPINITIN, NPUNITCB);
VOID   NEAR CD_Strat1 (PRPH);
VOID   NEAR CD_Strat1b (void);
USHORT NEAR CD_DriveInit (PRPINITIN, NPUNITCB);
USHORT NEAR CD_MediaCheck (PRP_MEDIACHECK, NPUNITCB);
USHORT NEAR CD_BuildBPB (PRP_BUILDBPB, NPUNITCB);
USHORT NEAR CD_Read (PRP_RWV, NPUNITCB);
USHORT NEAR RemovableMedia (PRPH, NPUNITCB);
USHORT NEAR DriveGenIOCTL (PRP_GENIOCTL, NPUNITCB);
USHORT NEAR f_CD_DriveGenIOCTL (PRP_GENIOCTL, NPUNITCB);
USHORT NEAR ResetMedia (PRPH, NPUNITCB);
USHORT NEAR GetLogDriveMap (PRPH, NPUNITCB);
USHORT NEAR SetLogDriveMap (PRPH, NPUNITCB);
USHORT NEAR PartFixedDisks (PRP_PARTFIXEDDISKS, NPUNITCB);
USHORT NEAR GetUnitMap (PRP_GETUNITMAP, NPUNITCB);
USHORT NEAR DiskIO (PBYTE, NPUNITCB);
USHORT NEAR DiskIO_Wait (PBYTE, NPUNITCB);
USHORT NEAR GetVolumeSize (NPUNITCB, ULONG FAR *);
USHORT NEAR ClearCheckCondition (NPUNITCB);
USHORT NEAR GetPlayStatus (NPUNITCB, BOOL FAR *);
USHORT NEAR Tosh_GetDensityCode(NPUNITCB, USHORT FAR *);
USHORT NEAR GetSectorMode(NPUNITCB, USHORT FAR *);
USHORT NEAR Get_UnitCB_Addr (UCHAR, NPUNITCB FAR *);
BOOL   NEAR Strncmp (UCHAR *, UCHAR *, USHORT);
USHORT NEAR Check_MultiSession_Mounted (NPUNITCB, ULONG);
VOID   NEAR SubmitRequestsToADD(NPUNITCB);
USHORT NEAR CmdErr (PRPH, NPUNITCB);
USHORT NEAR WriteErr (PRPH, NPUNITCB);
USHORT NEAR WriteVErr (PRPH, NPUNITCB);
USHORT NEAR StatusDevReady (PRPH, NPUNITCB);
USHORT NEAR StatusComplete (PRPH, NPUNITCB);
USHORT NEAR Submit_ModeSelect (NPUNITCB, USHORT, USHORT);
USHORT NEAR StatusError (PRPH, USHORT);
USHORT NEAR ChainModeSelectRead (NPUNITCB, ULONG, USHORT, ULONG,
                                                  USHORT, USHORT);
USHORT NEAR ReadSector (NPUNITCB, ULONG, USHORT, ULONG, USHORT);
USHORT NEAR CD_Read_2352 (NPUNITCB, ULONG, USHORT, ULONG);
USHORT NEAR ATAPI_Read_2352 (NPUNITCB, ULONG, USHORT, ULONG);
USHORT NEAR Tosh_Read_2048 (NPUNITCB, ULONG, USHORT, ULONG);
USHORT NEAR Tosh_Read_2352 (NPUNITCB, ULONG, USHORT, ULONG);
USHORT NEAR Sony_Read_2048 (NPUNITCB, ULONG, USHORT, ULONG);
USHORT NEAR Sony_Read_2352 (NPUNITCB, ULONG, USHORT, ULONG);

USHORT ReadTOC_Leadout (NPUNITCB, NPIORB_CDB);

/*
** cdiorb.c prologs
*/
USHORT AllocIORB (NPUNITCB, NPIORB FAR *);
VOID   AllocIORB_Wait (NPUNITCB, NPIORB FAR *);
VOID   FreeIORB (NPUNITCB, NPIORB_CDB);
VOID   BuildIORB_DeviceControl (NPUNITCB, USHORT, NPIORB FAR *);
VOID   BuildIORB_PassthruCDB (NPUNITCB, ULONG, ULONG, NPIORB_CDB FAR *);
VOID   BuildCDB_TestUnitReady(NPUNITCB, NPIORB_CDB FAR *);
VOID   BuildCDB_RezeroUnit(NPUNITCB, NPIORB_CDB FAR *);
VOID   BuildCDB_RequestSense(NPUNITCB, NPIORB_CDB FAR *);
VOID   BuildCDB_Read_6(NPUNITCB, ULONG, USHORT, USHORT,
                                         ULONG, NPIORB_CDB FAR *);
VOID   BuildCDB_Read_10(NPUNITCB, ULONG, USHORT, USHORT,
                                         ULONG, NPIORB_CDB FAR *);
VOID   BuildCDB_Seek_6(NPUNITCB, ULONG, NPIORB_CDB FAR *);
VOID   BuildCDB_Seek_10(NPUNITCB, ULONG, NPIORB_CDB FAR *);
VOID   BuildCDB_Inquiry(NPUNITCB, NPIORB_CDB FAR *);
VOID   BuildCDB_ModeSelect(NPUNITCB, USHORT, USHORT, NPIORB_CDB FAR *);
VOID   BuildCDB_AudioCOntrol(NPUNITCB, NPIORB_CDB FAR *);
VOID   BuildCDB_PreventAllowRemoval(NPUNITCB, USHORT, NPIORB_CDB FAR *);
VOID   BuildCDB_ReadCapacity(NPUNITCB, NPIORB_CDB FAR *);
VOID   BuildCDB_ReadSubChannel(NPUNITCB, USHORT, NPIORB_CDB FAR *);
VOID   BuildCDB_ReadTOC (NPUNITCB, USHORT, USHORT, NPIORB_CDB FAR *);
VOID   BuildCDB_ReadHeader (NPUNITCB, ULONG, NPIORB_CDB FAR *);
VOID   BuildCDB_PauseResume (NPUNITCB, USHORT, NPIORB_CDB FAR *);
VOID   BuildCDB_StartStopUnit (NPUNITCB, USHORT, NPIORB_CDB FAR *);
VOID   BuildCDB_PlayAudio_MSF (NPUNITCB, union AddressType,
                                         union AddressType, NPIORB_CDB FAR *);

VOID   _loadds FAR  NotifyDoneIORB(PIORB);
VOID  FAR  InitPost(PIORB);

/*-----------------------------------------------*
 * Function declarations for CDBLDCDB  routines  *
 *-----------------------------------------------*/
VOID BuildCBD_ReadCapacity (NPUNITCB, NPIORB FAR *);


/*-------------------------------------------------------*
 * Function declarations for CDASUBR assembler routines  *
 *-------------------------------------------------------*/
VOID   FAR  f_ZeroCB (PBYTE, USHORT);
VOID   FAR  f_BlockCopy (PBYTE, PBYTE, USHORT);
ULONG  FAR  f_add32(ULONG, ULONG);
VOID   FAR  f_SWait (PVOID);
VOID   NEAR SWait (PVOID);
VOID   FAR  f_SSig (PVOID);
VOID   NEAR SSig (PVOID);
VOID   NEAR ZeroFSGS (VOID);
VOID   NEAR PadRaw2340 (UCHAR FAR *, USHORT);

ULONG   HSGtoRedBook (ULONG);
ULONG   RedBookToHSG (ULONG);
UCHAR   BCDtoBinary (UCHAR);
UCHAR   BinaryToBCD (UCHAR);


/*-----------------------------------*
 * Pragma declarations - DevHelps    *
 *-----------------------------------*/
#pragma alloc_text(Code, DevHelp_VMUnLock)
#pragma alloc_text(Code, DevHelp_VMLock)
#pragma alloc_text(Code, DevHelp_VirtToLin)
#pragma alloc_text(Code, DevHelp_AllocReqPacket)
#pragma alloc_text(Code, DevHelp_FreeReqPacket)


