home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Misc / DC-POS24.LZX / pOS / IncPOS.lzx / Device / Trackdisk.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-03-18  |  4.3 KB  |  145 lines

  1. #ifndef __INC_POS_DEVICE_TRACKDISK_H
  2. #define __INC_POS_DEVICE_TRACKDISK_H
  3. /*******************************************************************
  4.  Includes Release 24
  5.  (C) Copyright 1995-1997 proDAD
  6.      All Rights Reserved
  7.  
  8.  $AUT Holger Burkarth
  9.  $DAT >>Trackdisk.h<<   23 Dec 1996    13:25:52 - (C) ProDAD
  10. *******************************************************************/
  11. #ifndef __INC_POS_PEXEC_DEVICE_H
  12. #include <pExec/Device.h>
  13. #endif
  14.  
  15.  
  16. /*----------------------------------
  17. -----------------------------------*/
  18. struct pOS_TrackdiskIO
  19. {
  20. /* struct pOS_IOStdReq */
  21.  
  22.   struct pOS_Message  tdio_Message;
  23.   struct pOS_Device  *tdio_Device;    /* device node pointer  */
  24.   struct pOS_Unit    *tdio_Unit;      /* unit (driver private)*/
  25.   UWORD               tdio_Command;   /* (enum pOS_IOReqCommands) */
  26.   UBYTE               tdio_Flags;     /* (enum pOS_IOReqFlags) */
  27.   SBYTE               tdio_Error;     /* (enum pOS_IOReqErrors) */
  28.   ULONG               tdio_Actual;    /* actual number of bytes transferred */
  29.   ULONG               tdio_Length;    /* requested number bytes transferred */
  30.   APTR                tdio_Data;      /* points to data area */
  31.   ULONG               tdio_HOffset;   /* High - Offset */
  32.   ULONG               tdio_LOffset;   /* Low - Offset */
  33.   UBYTE               tdio_Pad[8];
  34.   ULONG               tdio_Count;     /* Diskchange counter */
  35.   ULONG               tdio_SecLabel;
  36.  
  37.   UBYTE tdio_Reserved[32];
  38. };
  39.  
  40.  
  41. enum pOS_TrackdiskIOReqCommands
  42. {
  43.   TDCMDF_ExtCom = 0x8000,
  44.  
  45.   TDCMD_Motor=CMD_NONSTD,
  46.   TDCMD_Seek,
  47.   TDCMD_Format,
  48.   TDCMD_Notify,      /* Notify: Replyed by diskchange */
  49.   TDCMD_ChangeNum,
  50.   TDCMD_ChangeState,
  51.   TDCMD_ProtStatus,
  52.   TDCMD_RawRead,
  53.   TDCMD_RawWrite,
  54.   TDCMD_GetDriveType,
  55.   TDCMD_GetNumTracks,
  56.  
  57.   TDCMD_AddChangeInt, /* (struct pOS_Interrupt*) */
  58.   TDCMD_RemChangeInt, /* NOT AMIGA COMPATIBLE */
  59.  
  60.   TDCMD_GetGeometry,
  61.   TDCMD_Eject,
  62.   TDCMD_LastComm,
  63.  
  64.   TDCMDE_Write    = TDCMDF_ExtCom | CMD_WRITE,
  65.   TDCMDE_Read     = TDCMDF_ExtCom | CMD_READ,
  66.   TDCMDE_Motor    = TDCMDF_ExtCom | TDCMD_Motor,
  67.   TDCMDE_Seek     = TDCMDF_ExtCom | TDCMD_Seek,
  68.   TDCMDE_Format   = TDCMDF_ExtCom | TDCMD_Format,
  69.   TDCMDE_Update   = TDCMDF_ExtCom | CMD_UPDATE,
  70.   TDCMDE_Clear    = TDCMDF_ExtCom | CMD_CLEAR,
  71.   TDCMDE_RawRead  = TDCMDF_ExtCom | TDCMD_RawRead,
  72.   TDCMDE_RawWrite = TDCMDF_ExtCom | TDCMD_RawWrite,
  73.  
  74. };
  75.  
  76.  
  77. enum pOS_TrackdiskIOReqErrors
  78. {
  79.   TDIOERR_NotSpecified=    20, /* general catchall */
  80.   TDIOERR_NoSecHdr=        21, /* couldn't even find a sector */
  81.   TDIOERR_BadSecPreamble=  22, /* sector looked wrong */
  82.   TDIOERR_BadSecID=        23, /* ditto */
  83.   TDIOERR_BadHdrSum=       24, /* header had incorrect checksum */
  84.   TDIOERR_BadSecSum=       25, /* data had incorrect checksum */
  85.   TDIOERR_TooFewSecs=      26, /* couldn't find enough sectors */
  86.   TDIOERR_BadSecHdr=       27, /* another "sector looked wrong" */
  87.   TDIOERR_WriteProt=       28, /* can't write to a protected disk */
  88.   TDIOERR_DiskChanged=     29, /* no disk in the drive */
  89.   TDIOERR_SeekError=       30, /* couldn't find track 0 */
  90.   TDIOERR_NoMem=           31, /* ran out of memory */
  91.   TDIOERR_BadUnitNum=      32, /* asked for a unit > NUMUNITS */
  92.   TDIOERR_BadDriveType=    33, /* not a drive that trackdisk groks */
  93.   TDIOERR_DriveInUse=      34, /* someone else allocated the drive */
  94.   TDIOERR_PostReset=       35, /* user hit reset; awaiting doom */
  95. };
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102. struct pOS_DriveGeometry
  103. {
  104.   ULONG   dg_SectorSize;    /* in bytes */
  105.   ULONG   dg_TotalSectors;  /* total # of sectors on drive */
  106.   ULONG   dg_Cylinders;     /* number of cylinders */
  107.   ULONG   dg_CylSectors;    /* number of sectors/cylinder */
  108.   ULONG   dg_Heads;         /* number of surfaces */
  109.   ULONG   dg_TrackSectors;  /* number of sectors/track */
  110.   ULONG   dg_BufMemType;    /* preferred buffer memory type */
  111.                             /* (usually MEMF_PUBLIC) */
  112.   UBYTE   dg_DeviceType;    /* (enum pOS_DriveGeometryType) */
  113.   UBYTE   dg_Flags;         /* (enum pOS_DriveGeometryType) */
  114.   ULONG   dg_Reserved[16];
  115. };
  116.  
  117.  
  118.  
  119. enum pOS_DriveGeometryType /** dg_DeviceType **/
  120. {
  121.   DGEOTYP_DirectAccess = 0,
  122.   DGEOTYP_SequentialAccess,
  123.   DGEOTYP_Printer,
  124.   DGEOTYP_Processor,
  125.   DGEOTYP_Worm,
  126.   DGEOTYP_CDRom,
  127.   DGEOTYP_Scanner,
  128.   DGEOTYP_OpticalDisk,
  129.   DGEOTYP_MediumChanger,
  130.   DGEOTYP_Communication,
  131.  
  132.   DGEOTYP_Unknown = 31
  133. };
  134.  
  135.  
  136. enum pOS_DriveGeometryFlags  /** dg_Flags **/
  137. {
  138.   DGEOB_Removable = 0,
  139.  
  140.   DGEOF_Removable = 1,
  141. };
  142.  
  143.  
  144. #endif
  145.