Initial import of Scalos. To decrease size I have
[AROS-Contrib.git] / scalos / Modules / FormatDisk.Gadtools / NSD_64bit.c
blobc16bfb5e802f4f4b4132acc5765a80474b60a7b9
1 // NSD_64bit.c
2 // $Date$
3 // $Revision$
4 // $Id$
7 #include <exec/exec.h>
8 #include <devices/newstyle.h>
9 #include <proto/exec.h>
11 BOOL checkfor64bitcommandset(struct IOStdReq *io)
13 // struct IOStdReq io = { };
15 struct NSDeviceQueryResult nsdqr; // +jmc+ { } ??;
16 LONG error; // +jmc+ = 0
17 // BOOL newstyle = FALSE;
18 BOOL does64bit = FALSE;
19 UWORD *cmdcheck;
21 // newstyle = FALSE;
22 nsdqr.SizeAvailable = 0;
23 nsdqr.DevQueryFormat = 0;
25 io->io_Command = NSCMD_DEVICEQUERY;
26 io->io_Length = sizeof(nsdqr);
27 io->io_Data = (APTR)&nsdqr;
28 error = DoIO((struct IORequest *)io);
29 if ((!error) && (io->io_Actual >= 16) &&
30 (nsdqr.SizeAvailable == io->io_Actual) &&
31 (nsdqr.DeviceType == NSDEVTYPE_TRACKDISK))
33 // Ok, this must be a new style trackdisk device
34 // newstyle = TRUE;
36 // Is it safe to use 64 bits with this driver? We can reject
37 // bad mounts pretty easily via this check!
39 for(cmdcheck = nsdqr.SupportedCommands; *cmdcheck; cmdcheck++)
40 if(*cmdcheck == NSCMD_TD_READ64)
41 does64bit = TRUE;
42 // This trackdisk style device supports the complete
43 // 64 bit command set without returning IOERR_NOCMD!
45 return(does64bit);