sys_info.h revision 87816
165312Smsmith/* $FreeBSD: head/sys/dev/asr/sys_info.h 87816 2001-12-13 19:54:12Z jhb $ */ 265312Smsmith/* 365312Smsmith * Copyright (c) 1996-1999 Distributed Processing Technology Corporation 465312Smsmith * All rights reserved. 565312Smsmith * 665312Smsmith * Redistribution and use in source form, with or without modification, are 765312Smsmith * permitted provided that redistributions of source code must retain the 865312Smsmith * above copyright notice, this list of conditions and the following disclaimer. 965312Smsmith * 1065312Smsmith * This software is provided `as is' by Distributed Processing Technology and 1165312Smsmith * any express or implied warranties, including, but not limited to, the 1265312Smsmith * implied warranties of merchantability and fitness for a particular purpose, 1365312Smsmith * are disclaimed. In no event shall Distributed Processing Technology be 1465312Smsmith * liable for any direct, indirect, incidental, special, exemplary or 1565312Smsmith * consequential damages (including, but not limited to, procurement of 1665312Smsmith * substitute goods or services; loss of use, data, or profits; or business 1765312Smsmith * interruptions) however caused and on any theory of liability, whether in 1865312Smsmith * contract, strict liability, or tort (including negligence or otherwise) 1965312Smsmith * arising in any way out of the use of this driver software, even if advised 2065312Smsmith * of the possibility of such damage. 2165312Smsmith * 2265312Smsmith */ 2365312Smsmith 2465312Smsmith#ifndef __SYS_INFO_H 2565312Smsmith#define __SYS_INFO_H 2665312Smsmith 2765312Smsmith/*File - SYS_INFO.H 2865312Smsmith **************************************************************************** 2965312Smsmith * 3065312Smsmith *Description: 3165312Smsmith * 3265312Smsmith * This file contains structure definitions for the OS dependent 3365312Smsmith *layer system information buffers. 3465312Smsmith * 3565312Smsmith *Copyright Distributed Processing Technology, Corp. 3665312Smsmith * 140 Candace Dr. 3765312Smsmith * Maitland, Fl. 32751 USA 3865312Smsmith * Phone: (407) 830-5522 Fax: (407) 260-5366 3965312Smsmith * All Rights Reserved 4065312Smsmith * 4165312Smsmith *Author: Don Kemper 4265312Smsmith *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__)) 5565312Smsmith# include "i386/isa/dpt_osd_util.h" 5665312Smsmith#elif ((defined(KERNEL) || defined(_KERNEL)) && defined(__FreeBSD__)) 5765312Smsmith# if (KERN_VERSION < 3) 5865312Smsmith# include "i386/isa/dpt_osd_util.h" 5965312Smsmith# else 6065312Smsmith# include "dev/asr/osd_util.h" 6165312Smsmith# endif 6265312Smsmith#else 6365312Smsmith# include "osd_util.h" 6465312Smsmith#endif 6565312Smsmith 6665312Smsmith#ifndef NO_PACK 6765312Smsmith#if defined (_DPT_AIX) 6865312Smsmith#pragma options align=packed 6965312Smsmith#else 7065312Smsmith#pragma pack(1) 7165312Smsmith#endif /* aix */ 7287816Sjhb#endif /* no unpack */ 7365312Smsmith 7465312Smsmith 7565312Smsmith/*struct - driveParam_S - start 7665312Smsmith *=========================================================================== 7765312Smsmith * 7865312Smsmith *Description: 7965312Smsmith * 8065312Smsmith * This structure defines the drive parameters seen during 8165312Smsmith *booting. 8265312Smsmith * 8365312Smsmith *---------------------------------------------------------------------------*/ 8465312Smsmith 8565312Smsmith#ifdef __cplusplus 8665312Smsmith struct driveParam_S { 8765312Smsmith#else 8865312Smsmith typedef struct { 8965312Smsmith#endif 9065312Smsmith 9165312Smsmith uSHORT cylinders; /* Upto 1024 */ 9265312Smsmith uCHAR heads; /* Upto 255 */ 9365312Smsmith uCHAR sectors; /* Upto 63 */ 9465312Smsmith 9565312Smsmith#ifdef __cplusplus 9665312Smsmith 9765312Smsmith//---------- 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 */ 10265312Smsmith//-------------------------------------------- 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 * 11665312Smsmith * This structure defines the command system information that 11765312Smsmith *should be returned by every OS dependent layer. 11865312Smsmith * 11965312Smsmith *---------------------------------------------------------------------------*/ 12065312Smsmith 12165312Smsmith/*flags - bit definitions */ 12265312Smsmith#define SI_CMOS_Valid 0x0001 12365312Smsmith#define SI_NumDrivesValid 0x0002 12465312Smsmith#define SI_ProcessorValid 0x0004 12565312Smsmith#define SI_MemorySizeValid 0x0008 12665312Smsmith#define SI_DriveParamsValid 0x0010 12765312Smsmith#define SI_SmartROMverValid 0x0020 12865312Smsmith#define SI_OSversionValid 0x0040 12965312Smsmith#define SI_OSspecificValid 0x0080 /* 1 if OS structure returned */ 13065312Smsmith#define SI_BusTypeValid 0x0100 13165312Smsmith 13265312Smsmith#define SI_ALL_VALID 0x0FFF /* All Std SysInfo is valid */ 13365312Smsmith#define SI_NO_SmartROM 0x8000 13465312Smsmith 13565312Smsmith/*busType - definitions */ 13665312Smsmith#define SI_ISA_BUS 0x00 13765312Smsmith#define SI_MCA_BUS 0x01 13865312Smsmith#define SI_EISA_BUS 0x02 13965312Smsmith#define SI_PCI_BUS 0x04 14065312Smsmith 14165312Smsmith#ifdef __cplusplus 14265312Smsmith struct sysInfo_S { 14365312Smsmith#else 14465312Smsmith typedef struct { 14565312Smsmith#endif 14665312Smsmith 14765312Smsmith uCHAR drive0CMOS; /* CMOS Drive 0 Type */ 14865312Smsmith uCHAR drive1CMOS; /* CMOS Drive 1 Type */ 14965312Smsmith uCHAR numDrives; /* 0040:0075 contents */ 15065312Smsmith uCHAR processorFamily; /* Same as DPTSIG's definition */ 15165312Smsmith uCHAR processorType; /* Same as DPTSIG's definition */ 15265312Smsmith uCHAR smartROMMajorVersion; 15365312Smsmith uCHAR smartROMMinorVersion; /* SmartROM version */ 15465312Smsmith uCHAR smartROMRevision; 15565312Smsmith uSHORT flags; /* See bit definitions above */ 15665312Smsmith uSHORT conventionalMemSize; /* in KB */ 15765312Smsmith uLONG extendedMemSize; /* in KB */ 15865312Smsmith uLONG osType; /* Same as DPTSIG's definition */ 15965312Smsmith uCHAR osMajorVersion; 16065312Smsmith uCHAR osMinorVersion; /* The OS version */ 16165312Smsmith uCHAR osRevision; 16265312Smsmith#ifdef _SINIX_ADDON 16365312Smsmith uCHAR busType; /* See defininitions above */ 16465312Smsmith uSHORT osSubRevision; 16565312Smsmith uCHAR pad[2]; /* For alignment */ 16665312Smsmith#else 16765312Smsmith uCHAR osSubRevision; 16865312Smsmith uCHAR busType; /* See defininitions above */ 16965312Smsmith uCHAR pad[3]; /* For alignment */ 17065312Smsmith#endif 17165312Smsmith driveParam_S drives[16]; /* SmartROM Logical Drives */ 17265312Smsmith 17365312Smsmith#ifdef __cplusplus 17465312Smsmith 17565312Smsmith//---------- 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 */ 18065312Smsmith//-------------------------------------------- 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 * 19465312Smsmith * This structure defines the system information specific to a 19565312Smsmith *DOS workstation. 19665312Smsmith * 19765312Smsmith *---------------------------------------------------------------------------*/ 19865312Smsmith 19965312Smsmith/*flags - bit definitions */ 20065312Smsmith#define DI_DOS_HIGH 0x01 /* DOS is loaded high */ 20165312Smsmith#define DI_DPMI_VALID 0x02 /* DPMI version is valid */ 20265312Smsmith 20365312Smsmith#ifdef __cplusplus 20465312Smsmith struct DOS_Info_S { 20565312Smsmith#else 20665312Smsmith typedef struct { 20765312Smsmith#endif 20865312Smsmith 20965312Smsmith uCHAR flags; /* See bit definitions above */ 21065312Smsmith uSHORT driverLocation; /* SmartROM BIOS address */ 21165312Smsmith uSHORT DOS_version; 21265312Smsmith uSHORT DPMI_version; 21365312Smsmith 21465312Smsmith#ifdef __cplusplus 21565312Smsmith 21665312Smsmith//---------- 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 */ 22165312Smsmith//-------------------------------------------- 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 * 23565312Smsmith * This structure defines the system information specific to a 23665312Smsmith *Netware machine. 23765312Smsmith * 23865312Smsmith *---------------------------------------------------------------------------*/ 23965312Smsmith 24065312Smsmith#ifdef __cplusplus 24165312Smsmith struct Netware_Info_S { 24265312Smsmith#else 24365312Smsmith typedef struct { 24465312Smsmith#endif 24565312Smsmith 24665312Smsmith uCHAR driverName[13]; /* ie PM12NW31.DSK */ 24765312Smsmith uCHAR serverName[48]; 24865312Smsmith uCHAR netwareVersion; /* The Netware OS version */ 24965312Smsmith uCHAR netwareSubVersion; 25065312Smsmith uCHAR netwareRevision; 25165312Smsmith uSHORT maxConnections; /* Probably 250 or 1000 */ 25265312Smsmith uSHORT connectionsInUse; 25365312Smsmith uSHORT maxVolumes; 25465312Smsmith uCHAR unused; 25565312Smsmith uCHAR SFTlevel; 25665312Smsmith uCHAR TTSlevel; 25765312Smsmith 25865312Smsmith uCHAR clibMajorVersion; /* The CLIB.NLM version */ 25965312Smsmith uCHAR clibMinorVersion; 26065312Smsmith uCHAR clibRevision; 26165312Smsmith 26265312Smsmith#ifdef __cplusplus 26365312Smsmith 26465312Smsmith//---------- 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 */ 26965312Smsmith//-------------------------------------------- 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 * 28365312Smsmith * This structure defines the system information specific to an 28465312Smsmith *OS/2 machine. 28565312Smsmith * 28665312Smsmith *---------------------------------------------------------------------------*/ 28765312Smsmith 28865312Smsmith#ifdef __cplusplus 28965312Smsmith struct OS2_Info_S { 29065312Smsmith#else 29165312Smsmith typedef struct { 29265312Smsmith#endif 29365312Smsmith 29465312Smsmith uCHAR something; 29565312Smsmith 29665312Smsmith#ifdef __cplusplus 29765312Smsmith 29865312Smsmith//---------- 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 */ 30365312Smsmith//-------------------------------------------- 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 * 31765312Smsmith * This structure defines the system information specific to a 31865312Smsmith *Windows NT machine. 31965312Smsmith * 32065312Smsmith *---------------------------------------------------------------------------*/ 32165312Smsmith 32265312Smsmith#ifdef __cplusplus 32365312Smsmith struct WinNT_Info_S { 32465312Smsmith#else 32565312Smsmith typedef struct { 32665312Smsmith#endif 32765312Smsmith 32865312Smsmith uCHAR something; 32965312Smsmith 33065312Smsmith#ifdef __cplusplus 33165312Smsmith 33265312Smsmith//---------- 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 */ 33765312Smsmith//-------------------------------------------- 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 * 35165312Smsmith * This structure defines the system information specific to an 35265312Smsmith *SCO UNIX machine. 35365312Smsmith * 35465312Smsmith *---------------------------------------------------------------------------*/ 35565312Smsmith 35665312Smsmith#ifdef __cplusplus 35765312Smsmith struct SCO_Info_S { 35865312Smsmith#else 35965312Smsmith typedef struct { 36065312Smsmith#endif 36165312Smsmith 36265312Smsmith uCHAR something; 36365312Smsmith 36465312Smsmith#ifdef __cplusplus 36565312Smsmith 36665312Smsmith//---------- 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 */ 37165312Smsmith//-------------------------------------------- 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 * 38565312Smsmith * This structure defines the system information specific to a 38665312Smsmith *USL UNIX machine. 38765312Smsmith * 38865312Smsmith *---------------------------------------------------------------------------*/ 38965312Smsmith 39065312Smsmith#ifdef __cplusplus 39165312Smsmith struct USL_Info_S { 39265312Smsmith#else 39365312Smsmith typedef struct { 39465312Smsmith#endif 39565312Smsmith 39665312Smsmith uCHAR something; 39765312Smsmith 39865312Smsmith#ifdef __cplusplus 39965312Smsmith 40065312Smsmith//---------- 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 */ 40565312Smsmith//-------------------------------------------- 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 41665312Smsmith#if defined (_DPT_AIX) 41765312Smsmith#pragma options align=reset 41865312Smsmith#elif defined (UNPACK_FOUR) 41965312Smsmith#pragma pack(4) 42065312Smsmith#else 42165312Smsmith#pragma pack() 42265312Smsmith#endif /* aix */ 42387816Sjhb#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 46665312Smsmith#define SIZE_512 0 46765312Smsmith#define SIZE_1K 1 46865312Smsmith#define SIZE_2K 2 46965312Smsmith#define SIZE_4K 3 47065312Smsmith#define SIZE_8K 4 47165312Smsmith#define SIZE_16K 5 47265312Smsmith#define SIZE_32K 6 47365312Smsmith#define SIZE_64K 7 47465312Smsmith#define SIZE_BIGGER 8 47565312Smsmith#define SIZE_OTHER 9 47665312Smsmith 47765312Smsmith struct timeval intr_started; 47865312Smsmith} dpt_perf_t; 47965312Smsmith#endif 48065312Smsmith 48187816Sjhb#endif /* __SYS_INFO_H */ 48265312Smsmith 483