
      FastTrak66/100 v1.2.0.9 Ioctl Interface [02.11.2001]    


[SYNOPSIS]
       #include <sys/ioctl.h>
       int ioctl(int d, int command, *args)
   The "first" argument d must be an open file descriptor , such as 
   "/dev/sda" , "/dev/sdb" , ... ( which FastTrak driver mapped )


[IOCTL COMMANDS LIST]
   (1) [ARGUMENT]
           command: 0x3801   
           args   : ft_info_t *args
       [DESCRIPTION] 
           get all Adapters/Arrays status 

   (2) [ARGUMENT]
           command: 0x3802   
           args   : unsigned char args[512]
       [DESCRIPTION] 
           Identify Drive x 
           args[0] = '1' -> identify Primary/Master drive
           args[0] = '3' -> identify Secondary/Master drive

   (3) [ARGUMENT]
           command: 0x3803   
           args   : ft_swapbox_t *args[FT_Max_Dev]
       [DESCRIPTION]
           get all Swap Boxes information

   (4) [ARGUMENT]
           command: 0x3804   
           args   : unsigned char args[512]
       [DESCRIPTION]
           set Disable Mirroring Synchronous flag :
           FastTrak driver allows user to disable starting mirroring ,
           when system is critical and be going to rebuild array ,
           untill the flag has been disabled.
           args[0] = '1' -> disable mirroring synchronous
           args[0] = '0' -> enable mirroring synchronous

   (5) [ARGUMENT]
           command: 0x3806   
           args   : snmp_log_t 	args[50];
       [DESCRIPTION]
           dump event log such as Disk Offline , Disk Plugged in ,
           Disk Rebuild Started , Disk Rebuild Completed , .......


[RETURN VALUE]
   On success, zero is returned. On error, -1  is  returned.
   If argument "args" is NULL pointer , 0x10 will be returned.


[DATA STRUCTURE]
#define FT_Max_Ada	2
#define FT_Max_Arr	4
#define FT_Max_Dev	8 	

The SwapBox structure for IOCTL (0X3803)
typedef struct {
   unsigned char	present;   // box present
   unsigned char 	BoxID;     // different kind of box
   unsigned short	MIC;	   // monitor IC vendor ID
   unsigned long	RPM;
   unsigned short	TmpC;
   unsigned short	TmpF;
   unsigned short	Vcc;	   // (mv)
   unsigned short	V12;	   // (mv)
}  ft_swapbox_t ;

The Main Adapter structure for IOCTL(0x3801)
typedef struct {
   unsigned short	deviceid;
   unsigned char	irq;
   unsigned short	base[5];
   unsigned int 	rom;
}  ft_ladainfo_t ;

The Array structure for ft_info_t - IOCTL(0x3801)
typedef struct {
   unsigned char	ID;	   // array ID
   unsigned char	Flag;      // normal(0x0F)
   unsigned char 	RAID;      // RAID Mode
   unsigned char	StripeBlockPower;
   unsigned short	Cyl;
   unsigned char	Hd;
   unsigned char	Sctr;
   unsigned int		Size;      // total size
   unsigned int		Watermark; // has rebuilt size
   unsigned char	strm;      // component disks
}  ft_larrinfo_t ;

The Main Information structure for IOCTL (0x3801)
typedef struct {
   unsigned char	ver[30];
   ft_ladainfo_t	adainfo[FT_Max_Ada];
   ft_larrinfo_t	arrinfo[FT_Max_Arr];
   unsigned char	rebdev;    // rebuilding drive
}  ft_info_t ;

//event log struct provided thru ioctl
typedef struct {
   int sequence;
   int eventid;
   int arrayid;
   int diskid;
} snmp_log_t;
