;	SCCSID = @(#)dskioctl.inc	6.2 91/01/30
;      SCCSID = @(#)dskioctl.inc	6.2 91/01/30

;***	DSKIOCTL.INC
;
;	These are all the important structures and equates for
;	the disk ioctl.
;

;  IOC_DC sub-functions - DOS 3.2 codes

SET_DEVICE_PARAMETERS	equ	40H
WRITE_TRACK		equ	41H
FORMAT_TRACK		equ	42H
GET_DEVICE_PARAMETERS	equ	60H
READ_TRACK		equ	61H
VERIFY_TRACK		equ	62H

;  Special function for Get Device Parameters

BUILD_DEVICE_BPB	equ	000000001B

;  Special Functions for Set Device Parameters - 3.20 version

INSTALL_FAKE_BPB	equ	000000001B
ONLY_SET_TRACKLAYOUT	equ	000000010B
TRACKLAYOUT_IS_GOOD	equ	000000100B

;  Special function for Format Track - 3.20 version

STATUS_FOR_FORMAT	equ	000000001B

;  Codes returned from Format Status Call

FORMAT_NO_ROM_SUPPORT		equ	000000001B
FORMAT_COMB_NOT_SUPPORTED	equ	000000010B

;  DeviceType values

MAX_SECTORS_IN_TRACK	equ	40	; Maximum sectors on a disk
DEV_5INCH		equ	0
DEV_5INCH96TPI		equ	1
DEV_3INCH720KB		equ	2
DEV_8INCHSS		equ	3
DEV_8INCHDS		equ	4
DEV_HARDDISK		equ	5
DEV_OTHER		equ	7

MAX_DEV_TYPE		equ	7	; maximum device type that we
					; currently support.

a_SectorTable			struc
	ST_SectorNumber 	dw	?
	ST_SectorSize		dw	?
a_SectorTable			ends

a_SectorTable2			struc
	ST_C			db	?
	ST_H			db	?
	ST_R			db	?
	ST_N			db	?
a_SectorTable2			ends

;  Structure definitions for structures used for the Int 21H Generic IOCTL
;  function calls.

DP_SECTOR_TABLE_SIZE	equ	MAX_SECTORS_IN_TRACK * size a_SectorTable

a_DeviceParameters		struc
	DP_SpecialFunctions	db	?
	DP_DeviceType		db	?
	DP_DeviceAttributes	dw	?
	DP_Cylinders		dw	?
	DP_MediaType		db	?
	DP_BPB			db	size a_BPB dup(?)
	DP_TrackTableEntries	dw	?
	DP_SectorTable		db	DP_SECTOR_TABLE_SIZE dup(?)
a_DeviceParameters		ends

a_TrackReadWritePacket		struc
	TRWP_SpecialFunctions	db	?
	TRWP_Head		dw	?
	TRWP_Cylinder		dw	?
	TRWP_FirstSector	dw	?
	TRWP_SectorsToReadWrite dw	?
	TRWP_TransferAddress	dd	?
a_TrackReadWritePacket		ends

a_FormatPacket			struc
	FP_SpecialFunctions	db	?
	FP_Head 		dw	?
	FP_Cylinder		dw	?
a_FormatPacket			ends

a_VerifyPacket			struc
	VP_SpecialFunctions	db	?
	VP_Head 		dw	?
	VP_Cylinder		dw	?
a_VerifyPacket			ends

; Category 9, function 63H, get physical device parameters

DDI_PhysDeviceParameters_data	struc
	DDI_PDP_Reserved1   dw	    ?
	DDI_PDP_Cylinders   dw	    ?
	DDI_PDP_Heads	    dw	    ?
	DDI_PDP_Sectors     dw	    ?
	DDI_PDP_Reserved2   dw	    4 dup (?)
DDI_PhysDeviceParameters_data	ends

ReadBack_data		    struc		; @@readback
	RBAction	    db	    ?
	RBDmaOverrunCount   dw	    ?
	RBCount 	    dw	    ?
	RBMiscompares	    dw	    ?
ReadBack_data		    ends

;  Structure definitions for the DOS 5.0 DOSDevIOCTL function calls.

DDI_DeviceParameters_param	struc
	DDI_DP_Command		db	?
DDI_DeviceParameters_param	ends

DDI_DeviceParameters_data	struc
	DDI_DP_BPB		db	size a_BPB dup (?)
	DDI_DP_Cyln		dw	?
	DDI_DP_DeviceType	db	?
	DDI_DP_DeviceAttr	dw	?
DDI_DeviceParameters_data	ends

; Media Sense structure definitions	; @9410

DDI_MediaSense_param	  struc
	DDI_MS_Command		db	?
DDI_MediaSense_param	  ends

DDI_MediaSense_data	  struc
	DDI_MS_BPB		db	?
DDI_MediaSense_data	  ends

;  Format and Verify track

DDI_FormatPacket_param		struc
	DDI_FP_Command		db	?
	DDI_FP_Head		dw	?
	DDI_FP_Cyln		dw	?
	DDI_FP_Reserved 	dw	?
	DDI_FP_NumSec		dw	?
	DDI_FP_TTable		dd	?
DDI_FormatPacket_param		ends

;  Read/Write/Verify Track

DDI_RWVPacket_param		struc
	DDI_RWV_Command 	db	?
	DDI_RWV_Head		dw	?
	DDI_RWV_Cyln		dw	?
	DDI_RWV_Sec		dw	0
	DDI_RWV_NumSec		dw	?
	DDI_RWV_TTable		dd	?
DDI_RWVPacket_param		ends

DDI_MapPacket	struc
	DDI_MP_Drive		db	?
DDI_MapPacket	ends

GEN_IOCTL_FN_TST	EQU	20h	    ; Used to differentiate between
					    ; reads and writes.

;  Function test equates for Set Device Parameters function - DOS 5.0 version

SET_DEVICE_BPB		EQU	01H	    ; Set BPB for physical device
SET_MEDIA_BPB		EQU	02H	    ; Set BPB for medium


