1139749Simp/*-
265312Smsmith * Copyright (c) 1996-1999 Distributed Processing Technology Corporation
365312Smsmith * All rights reserved.
465312Smsmith *
565312Smsmith * Redistribution and use in source form, with or without modification, are
665312Smsmith * permitted provided that redistributions of source code must retain the
765312Smsmith * above copyright notice, this list of conditions and the following disclaimer.
865312Smsmith *
965312Smsmith * This software is provided `as is' by Distributed Processing Technology and
1065312Smsmith * any express or implied warranties, including, but not limited to, the
1165312Smsmith * implied warranties of merchantability and fitness for a particular purpose,
1265312Smsmith * are disclaimed. In no event shall Distributed Processing Technology be
1365312Smsmith * liable for any direct, indirect, incidental, special, exemplary or
1465312Smsmith * consequential damages (including, but not limited to, procurement of
1565312Smsmith * substitute goods or services; loss of use, data, or profits; or business
1665312Smsmith * interruptions) however caused and on any theory of liability, whether in
1765312Smsmith * contract, strict liability, or tort (including negligence or otherwise)
1865312Smsmith * arising in any way out of the use of this driver software, even if advised
1965312Smsmith * of the possibility of such damage.
2065312Smsmith *
2187826Sobrien * $FreeBSD$
2265312Smsmith */
2365312Smsmith
2496554Sobrien#ifndef		__SYS_INFO_H
2596554Sobrien#define		__SYS_INFO_H
2665312Smsmith
2765312Smsmith/*File - SYS_INFO.H
2865312Smsmith ****************************************************************************
2965312Smsmith *
3065312Smsmith *Description:
3165312Smsmith *
3296554Sobrien *	This file contains structure definitions for the OS dependent
3365312Smsmith *layer system information buffers.
3465312Smsmith *
3565312Smsmith *Copyright Distributed Processing Technology, Corp.
3696554Sobrien *	  140 Candace Dr.
3796554Sobrien *	  Maitland, Fl. 32751	USA
3896554Sobrien *	  Phone: (407) 830-5522	 Fax: (407) 260-5366
3996554Sobrien *	  All Rights Reserved
4065312Smsmith *
4196554Sobrien *Author:	Don Kemper
4296554Sobrien *Date:		5/10/94
4365312Smsmith *
4465312Smsmith *Editors:
4565312Smsmith *
4665312Smsmith *Remarks:
4765312Smsmith *
4865312Smsmith *
4965312Smsmith *****************************************************************************/
5065312Smsmith
5165312Smsmith
5265312Smsmith/*Include Files ------------------------------------------------------------- */
5365312Smsmith
5465312Smsmith#if (defined(KERNEL) && defined(__bsdi__))
5596554Sobrien# include	 "i386/isa/dpt_osd_util.h"
5665312Smsmith#elif ((defined(KERNEL) || defined(_KERNEL)) && defined(__FreeBSD__))
5765312Smsmith# if (KERN_VERSION < 3)
5896554Sobrien#  include	  "i386/isa/dpt_osd_util.h"
5965312Smsmith# else
6096554Sobrien#  include	  "dev/asr/osd_util.h"
6165312Smsmith# endif
6265312Smsmith#else
6396554Sobrien# include	 "osd_util.h"
6465312Smsmith#endif
6565312Smsmith
6665312Smsmith#ifndef NO_PACK
6796614Sobrien#if defined(_DPT_AIX)
6865312Smsmith#pragma options align=packed
6965312Smsmith#else
7065312Smsmith#pragma pack(1)
7196554Sobrien#endif	/* aix */
7296554Sobrien#endif	/* no unpack */
7365312Smsmith
7465312Smsmith
7565312Smsmith/*struct - driveParam_S - start
7665312Smsmith *===========================================================================
7765312Smsmith *
7865312Smsmith *Description:
7965312Smsmith *
8096554Sobrien *	This structure defines the drive parameters seen during
8165312Smsmith *booting.
8265312Smsmith *
8365312Smsmith *---------------------------------------------------------------------------*/
8465312Smsmith
8596554Sobrien#ifdef __cplusplus
8665312Smsmith   struct driveParam_S {
8765312Smsmith#else
8865312Smsmith   typedef struct  {
8965312Smsmith#endif
9065312Smsmith
9196554Sobrien   uSHORT	cylinders;	/* Upto 1024 */
9296554Sobrien   uCHAR	heads;		/* Upto 255 */
9396554Sobrien   uCHAR	sectors;	/* Upto 63 */
9465312Smsmith
9596554Sobrien#ifdef __cplusplus
9665312Smsmith
9787826Sobrien/*---------- Portability Additions ----------- in sp_sinfo.cpp */
9865312Smsmith#ifdef DPT_PORTABLE
9965312Smsmith	uSHORT		netInsert(dptBuffer_S *buffer);
10065312Smsmith	uSHORT		netExtract(dptBuffer_S *buffer);
10187816Sjhb#endif /* DPT PORTABLE */
10287826Sobrien/*--------------------------------------------*/
10365312Smsmith
10465312Smsmith   };
10565312Smsmith#else
10665312Smsmith   } driveParam_S;
10765312Smsmith#endif
10865312Smsmith/*driveParam_S - end */
10965312Smsmith
11065312Smsmith
11165312Smsmith/*struct - sysInfo_S - start
11265312Smsmith *===========================================================================
11365312Smsmith *
11465312Smsmith *Description:
11565312Smsmith *
11696554Sobrien *	This structure defines the command system information that
11765312Smsmith *should be returned by every OS dependent layer.
11865312Smsmith *
11965312Smsmith *---------------------------------------------------------------------------*/
12065312Smsmith
12165312Smsmith/*flags - bit definitions */
12296615Sobrien#define	SI_CMOS_Valid		0x0001
12396615Sobrien#define	SI_NumDrivesValid	0x0002
12496615Sobrien#define	SI_ProcessorValid	0x0004
12596615Sobrien#define	SI_MemorySizeValid	0x0008
12696615Sobrien#define	SI_DriveParamsValid	0x0010
12796615Sobrien#define	SI_SmartROMverValid	0x0020
12896615Sobrien#define	SI_OSversionValid	0x0040
12996615Sobrien#define	SI_OSspecificValid	0x0080	/* 1 if OS structure returned */
13096615Sobrien#define	SI_BusTypeValid		0x0100
13165312Smsmith
13296615Sobrien#define	SI_ALL_VALID		0x0FFF	/* All Std SysInfo is valid */
13396615Sobrien#define	SI_NO_SmartROM		0x8000
13465312Smsmith
13565312Smsmith/*busType - definitions */
13696615Sobrien#define	SI_ISA_BUS	0x00
13796615Sobrien#define	SI_MCA_BUS	0x01
13896615Sobrien#define	SI_EISA_BUS	0x02
13996615Sobrien#define	SI_PCI_BUS	0x04
14065312Smsmith
14196554Sobrien#ifdef __cplusplus
14265312Smsmith   struct sysInfo_S {
14365312Smsmith#else
14465312Smsmith   typedef struct  {
14565312Smsmith#endif
14665312Smsmith
14796554Sobrien   uCHAR	drive0CMOS;		/* CMOS Drive 0 Type */
14896554Sobrien   uCHAR	drive1CMOS;		/* CMOS Drive 1 Type */
14996554Sobrien   uCHAR	numDrives;		/* 0040:0075 contents */
15096554Sobrien   uCHAR	processorFamily;	/* Same as DPTSIG's definition */
15196554Sobrien   uCHAR	processorType;		/* Same as DPTSIG's definition */
15296554Sobrien   uCHAR	smartROMMajorVersion;
15396554Sobrien   uCHAR	smartROMMinorVersion;	/* SmartROM version */
15496554Sobrien   uCHAR	smartROMRevision;
15596554Sobrien   uSHORT	flags;			/* See bit definitions above */
15696554Sobrien   uSHORT	conventionalMemSize;	/* in KB */
15796554Sobrien   uLONG	extendedMemSize;	/* in KB */
15896554Sobrien   uLONG	osType;			/* Same as DPTSIG's definition */
15996554Sobrien   uCHAR	osMajorVersion;
16096554Sobrien   uCHAR	osMinorVersion;		/* The OS version */
16196554Sobrien   uCHAR	osRevision;
16265312Smsmith#ifdef _SINIX_ADDON
16396554Sobrien   uCHAR	busType;		/* See defininitions above */
16496554Sobrien   uSHORT	osSubRevision;
16596554Sobrien   uCHAR	pad[2];			/* For alignment */
16665312Smsmith#else
16796554Sobrien   uCHAR	osSubRevision;
16896554Sobrien   uCHAR	busType;		/* See defininitions above */
16996554Sobrien   uCHAR	pad[3];			/* For alignment */
17065312Smsmith#endif
17196554Sobrien   driveParam_S drives[16];		/* SmartROM Logical Drives */
17265312Smsmith
17396554Sobrien#ifdef __cplusplus
17465312Smsmith
17587826Sobrien/*---------- Portability Additions ----------- in sp_sinfo.cpp */
17665312Smsmith#ifdef DPT_PORTABLE
17765312Smsmith	uSHORT		netInsert(dptBuffer_S *buffer);
17865312Smsmith	uSHORT		netExtract(dptBuffer_S *buffer);
17987816Sjhb#endif /* DPT PORTABLE */
18087826Sobrien/*--------------------------------------------*/
18165312Smsmith
18265312Smsmith   };
18365312Smsmith#else
18465312Smsmith   } sysInfo_S;
18565312Smsmith#endif
18665312Smsmith/*sysInfo_S - end */
18765312Smsmith
18865312Smsmith
18965312Smsmith/*struct - DOS_Info_S - start
19065312Smsmith *===========================================================================
19165312Smsmith *
19265312Smsmith *Description:
19365312Smsmith *
19496554Sobrien *	This structure defines the system information specific to a
19565312Smsmith *DOS workstation.
19665312Smsmith *
19765312Smsmith *---------------------------------------------------------------------------*/
19865312Smsmith
19965312Smsmith/*flags - bit definitions */
20096615Sobrien#define	DI_DOS_HIGH		0x01	/* DOS is loaded high */
20196615Sobrien#define	DI_DPMI_VALID		0x02	/* DPMI version is valid */
20265312Smsmith
20396554Sobrien#ifdef __cplusplus
20465312Smsmith   struct DOS_Info_S {
20565312Smsmith#else
20665312Smsmith   typedef struct {
20765312Smsmith#endif
20865312Smsmith
20996554Sobrien   uCHAR	flags;		/* See bit definitions above */
21096554Sobrien   uSHORT	driverLocation; /* SmartROM BIOS address */
21196554Sobrien   uSHORT	DOS_version;
21296554Sobrien   uSHORT	DPMI_version;
21365312Smsmith
21496554Sobrien#ifdef __cplusplus
21565312Smsmith
21687826Sobrien/*---------- Portability Additions ----------- in sp_sinfo.cpp */
21765312Smsmith#ifdef DPT_PORTABLE
21865312Smsmith	uSHORT		netInsert(dptBuffer_S *buffer);
21965312Smsmith	uSHORT		netExtract(dptBuffer_S *buffer);
22087816Sjhb#endif /* DPT PORTABLE */
22187826Sobrien/*--------------------------------------------*/
22265312Smsmith
22365312Smsmith   };
22465312Smsmith#else
22565312Smsmith   } DOS_Info_S;
22665312Smsmith#endif
22765312Smsmith/*DOS_Info_S - end */
22865312Smsmith
22965312Smsmith
23065312Smsmith/*struct - Netware_Info_S - start
23165312Smsmith *===========================================================================
23265312Smsmith *
23365312Smsmith *Description:
23465312Smsmith *
23596554Sobrien *	This structure defines the system information specific to a
23665312Smsmith *Netware machine.
23765312Smsmith *
23865312Smsmith *---------------------------------------------------------------------------*/
23965312Smsmith
24096554Sobrien#ifdef __cplusplus
24165312Smsmith   struct Netware_Info_S {
24265312Smsmith#else
24365312Smsmith   typedef struct {
24465312Smsmith#endif
24565312Smsmith
24696554Sobrien   uCHAR	driverName[13];		/* ie PM12NW31.DSK */
24796554Sobrien   uCHAR	serverName[48];
24896554Sobrien   uCHAR	netwareVersion;		/* The Netware OS version */
24996554Sobrien   uCHAR	netwareSubVersion;
25096554Sobrien   uCHAR	netwareRevision;
25196554Sobrien   uSHORT	maxConnections;		/* Probably  250 or 1000 */
25296554Sobrien   uSHORT	connectionsInUse;
25396554Sobrien   uSHORT	maxVolumes;
25496554Sobrien   uCHAR	unused;
25596554Sobrien   uCHAR	SFTlevel;
25696554Sobrien   uCHAR	TTSlevel;
25765312Smsmith
25896554Sobrien   uCHAR	clibMajorVersion;	/* The CLIB.NLM version */
25996554Sobrien   uCHAR	clibMinorVersion;
26096554Sobrien   uCHAR	clibRevision;
26165312Smsmith
26296554Sobrien#ifdef __cplusplus
26365312Smsmith
26487826Sobrien/*---------- Portability Additions ----------- in sp_sinfo.cpp */
26565312Smsmith#ifdef DPT_PORTABLE
26665312Smsmith	uSHORT		netInsert(dptBuffer_S *buffer);
26765312Smsmith	uSHORT		netExtract(dptBuffer_S *buffer);
26887816Sjhb#endif /* DPT PORTABLE */
26987826Sobrien/*--------------------------------------------*/
27065312Smsmith
27165312Smsmith   };
27265312Smsmith#else
27365312Smsmith   } Netware_Info_S;
27465312Smsmith#endif
27565312Smsmith/*Netware_Info_S - end */
27665312Smsmith
27765312Smsmith
27865312Smsmith/*struct - OS2_Info_S - start
27965312Smsmith *===========================================================================
28065312Smsmith *
28165312Smsmith *Description:
28265312Smsmith *
28396554Sobrien *	This structure defines the system information specific to an
28465312Smsmith *OS/2 machine.
28565312Smsmith *
28665312Smsmith *---------------------------------------------------------------------------*/
28765312Smsmith
28896554Sobrien#ifdef __cplusplus
28965312Smsmith   struct OS2_Info_S {
29065312Smsmith#else
29165312Smsmith   typedef struct {
29265312Smsmith#endif
29365312Smsmith
29496554Sobrien   uCHAR	something;
29565312Smsmith
29696554Sobrien#ifdef __cplusplus
29765312Smsmith
29887826Sobrien/*---------- Portability Additions ----------- in sp_sinfo.cpp */
29965312Smsmith#ifdef DPT_PORTABLE
30065312Smsmith	uSHORT		netInsert(dptBuffer_S *buffer);
30165312Smsmith	uSHORT		netExtract(dptBuffer_S *buffer);
30287816Sjhb#endif /* DPT PORTABLE */
30387826Sobrien/*--------------------------------------------*/
30465312Smsmith
30565312Smsmith   };
30665312Smsmith#else
30765312Smsmith   } OS2_Info_S;
30865312Smsmith#endif
30965312Smsmith/*OS2_Info_S - end */
31065312Smsmith
31165312Smsmith
31265312Smsmith/*struct - WinNT_Info_S - start
31365312Smsmith *===========================================================================
31465312Smsmith *
31565312Smsmith *Description:
31665312Smsmith *
31796554Sobrien *	This structure defines the system information specific to a
31865312Smsmith *Windows NT machine.
31965312Smsmith *
32065312Smsmith *---------------------------------------------------------------------------*/
32165312Smsmith
32296554Sobrien#ifdef __cplusplus
32365312Smsmith   struct WinNT_Info_S {
32465312Smsmith#else
32565312Smsmith   typedef struct {
32665312Smsmith#endif
32765312Smsmith
32896554Sobrien   uCHAR	something;
32965312Smsmith
33096554Sobrien#ifdef __cplusplus
33165312Smsmith
33287826Sobrien/*---------- Portability Additions ----------- in sp_sinfo.cpp */
33365312Smsmith#ifdef DPT_PORTABLE
33465312Smsmith	uSHORT		netInsert(dptBuffer_S *buffer);
33565312Smsmith	uSHORT		netExtract(dptBuffer_S *buffer);
33687816Sjhb#endif /* DPT PORTABLE */
33787826Sobrien/*--------------------------------------------*/
33865312Smsmith
33965312Smsmith   };
34065312Smsmith#else
34165312Smsmith   } WinNT_Info_S;
34265312Smsmith#endif
34365312Smsmith/*WinNT_Info_S - end */
34465312Smsmith
34565312Smsmith
34665312Smsmith/*struct - SCO_Info_S - start
34765312Smsmith *===========================================================================
34865312Smsmith *
34965312Smsmith *Description:
35065312Smsmith *
35196554Sobrien *	This structure defines the system information specific to an
35265312Smsmith *SCO UNIX machine.
35365312Smsmith *
35465312Smsmith *---------------------------------------------------------------------------*/
35565312Smsmith
35696554Sobrien#ifdef __cplusplus
35765312Smsmith   struct SCO_Info_S {
35865312Smsmith#else
35965312Smsmith   typedef struct {
36065312Smsmith#endif
36165312Smsmith
36296554Sobrien   uCHAR	something;
36365312Smsmith
36496554Sobrien#ifdef __cplusplus
36565312Smsmith
36687826Sobrien/*---------- Portability Additions ----------- in sp_sinfo.cpp */
36765312Smsmith#ifdef DPT_PORTABLE
36865312Smsmith	uSHORT		netInsert(dptBuffer_S *buffer);
36965312Smsmith	uSHORT		netExtract(dptBuffer_S *buffer);
37087816Sjhb#endif /* DPT PORTABLE */
37187826Sobrien/*--------------------------------------------*/
37265312Smsmith
37365312Smsmith   };
37465312Smsmith#else
37565312Smsmith   } SCO_Info_S;
37665312Smsmith#endif
37765312Smsmith/*SCO_Info_S - end */
37865312Smsmith
37965312Smsmith
38065312Smsmith/*struct - USL_Info_S - start
38165312Smsmith *===========================================================================
38265312Smsmith *
38365312Smsmith *Description:
38465312Smsmith *
38596554Sobrien *	This structure defines the system information specific to a
38665312Smsmith *USL UNIX machine.
38765312Smsmith *
38865312Smsmith *---------------------------------------------------------------------------*/
38965312Smsmith
39096554Sobrien#ifdef __cplusplus
39165312Smsmith   struct USL_Info_S {
39265312Smsmith#else
39365312Smsmith   typedef struct {
39465312Smsmith#endif
39565312Smsmith
39696554Sobrien   uCHAR	something;
39765312Smsmith
39896554Sobrien#ifdef __cplusplus
39965312Smsmith
40087826Sobrien/*---------- Portability Additions ----------- in sp_sinfo.cpp */
40165312Smsmith#ifdef DPT_PORTABLE
40265312Smsmith	uSHORT		netInsert(dptBuffer_S *buffer);
40365312Smsmith	uSHORT		netExtract(dptBuffer_S *buffer);
40487816Sjhb#endif /* DPT PORTABLE */
40587826Sobrien/*--------------------------------------------*/
40665312Smsmith
40765312Smsmith   };
40865312Smsmith#else
40965312Smsmith   } USL_Info_S;
41065312Smsmith#endif
41165312Smsmith/*USL_Info_S - end */
41265312Smsmith
41365312Smsmith
41465312Smsmith  /* Restore default structure packing */
41565312Smsmith#ifndef NO_UNPACK
41696614Sobrien#if defined(_DPT_AIX)
41765312Smsmith#pragma options align=reset
41896614Sobrien#elif defined(UNPACK_FOUR)
41965312Smsmith#pragma pack(4)
42065312Smsmith#else
42165312Smsmith#pragma pack()
42296554Sobrien#endif	/* aix */
42396554Sobrien#endif	/* no unpack */
42465312Smsmith
42565312Smsmith#ifdef DPT_MEASURE_PERFORMANCE
42665312Smsmithtypedef struct dpt_metrics {
42765312Smsmith	u_int32_t	command_count[256]; /* We assume MAX 256 SCSI commands */
42865312Smsmith	u_int32_t	max_command_time[256];
42965312Smsmith	u_int32_t	min_command_time[256];
43065312Smsmith
43165312Smsmith	u_int32_t	min_intr_time;
43265312Smsmith	u_int32_t	max_intr_time;
43365312Smsmith	u_int32_t	max_intr_gap;
43465312Smsmith	u_int32_t	max_ht_time;
43565312Smsmith	u_int32_t	aborted_interrupts;
43665312Smsmith	u_int32_t	spurious_interrupts;
43765312Smsmith	u_int32_t	aborted_requests;
43865312Smsmith	u_int32_t	retried_requests;
43965312Smsmith
44065312Smsmith	u_int32_t	max_waiting_count;
44165312Smsmith	u_int32_t	max_submit_count;
44265312Smsmith	u_int32_t	max_complete_count;
44365312Smsmith
44465312Smsmith	u_int32_t	min_waiting_time;
44565312Smsmith	u_int32_t	min_submit_time;
44665312Smsmith	u_int32_t	min_complete_time;
44765312Smsmith
44865312Smsmith	u_int32_t	max_waiting_time;
44965312Smsmith	u_int32_t	max_submit_time;
45065312Smsmith	u_int32_t	max_complete_time;
45165312Smsmith
45265312Smsmith	u_int32_t	command_collisions;
45365312Smsmith	u_int32_t	command_too_busy;
45465312Smsmith	u_int32_t	max_eata_tries;
45565312Smsmith	u_int32_t	min_eata_tries;
45665312Smsmith
45765312Smsmith	u_int32_t	read_by_size_count[10];
45865312Smsmith	u_int32_t	write_by_size_count[10];
45965312Smsmith	u_int32_t	read_by_size_min_time[10];
46065312Smsmith	u_int32_t	read_by_size_max_time[10];
46165312Smsmith	struct timeval	read_by_size_total_time[10];
46265312Smsmith	u_int32_t	write_by_size_min_time[10];
46365312Smsmith	u_int32_t	write_by_size_max_time[10];
46465312Smsmith	struct timeval	write_by_size_total_time[10];
46565312Smsmith
46696615Sobrien#define	SIZE_512	0
46796615Sobrien#define	SIZE_1K		1
46896615Sobrien#define	SIZE_2K		2
46996615Sobrien#define	SIZE_4K		3
47096615Sobrien#define	SIZE_8K		4
47196615Sobrien#define	SIZE_16K	5
47296615Sobrien#define	SIZE_32K	6
47396615Sobrien#define	SIZE_64K	7
47496615Sobrien#define	SIZE_BIGGER	8
47596615Sobrien#define	SIZE_OTHER	9
47665312Smsmith
47765312Smsmith	struct timeval	intr_started;
47865312Smsmith} dpt_perf_t;
47965312Smsmith#endif
48065312Smsmith
48196554Sobrien#endif	/* __SYS_INFO_H */
48265312Smsmith
483